This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16 | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Install app dependencies | |
# A wildcard is used to ensure both package.json AND package-lock.json are copied | |
# where available (npm@5+) | |
COPY package*.json ./ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
src=”https://angularjs/angle.js” | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app = “”> | |
........ | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> Enter your Required Name: <input type = “text” ng-model = “name”></p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> Hello <span ng-bind = “name”></span>!</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class SeleniumPlaygroundPageLocators(object): | |
#locators | |
file_download = (By.XPATH, '//li[.="File Download"]') | |
data_field = (By.XPATH, '//*[@id="textbox"]') | |
generate_file = (By.ID, 'create') | |
download_button = (By.XPATH, '//*[@id="link-to-download"]') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
class Browser(unittest.TestCase): | |
def setUp(self): | |
PATH = "/Users/macbookair/Desktop/how_download_files_selenium_python/download" | |
#Safari | |
self.driver = webdriver.Safari() | |
self.driver.get("https://www.lambdatest.com/selenium-playground/") | |
def tearDown(self): | |
self.driver.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.keys import Keys | |
from utils.locators import * | |
import time | |
# Page objects are written in this module. | |
class Selenium_Playground_Page(): | |
def __init__(self, driver): | |
self.locator = SeleniumPlaygroundPageLocators | |
self.driver = driver | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
class Browser(unittest.TestCase): | |
def setUp(self): | |
PATH = "/Users/macbookair/Desktop/how_download_files_selenium_python/download" #This path must be modified according to your OS and the directory where you want to save your file | |
self.driver.get("https://www.lambdatest.com/selenium-playground/") | |
def tearDown(self): | |
self.driver.close() | |
if __name__ == '__main__': | |
unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from tests.conftest import Browser | |
from pages.selenium_playground_page import * | |
# I am using python unittest for asserting cases. | |
class TestDownloadFile(Browser): | |
def test_download(self): | |
page = Selenium_Playground_Page(self.driver) | |
download_file = page.download("How to download files using Selenium & Python?") |