Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW3 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

HW3 #13

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions selenium_selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,40 @@
Add couple selenium tests
1. Submit filled test form
https://demoqa.com/text-box
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
TEST_DATA = {
'full_name': 'Iryna',
'email': '[email protected]',
'current_address': 'Lviv'
}
driver = webdriver.Chrome()
driver.get("https://demoqa.com/text-box")
time.sleep(3)
driver.find_element_by_css_selector("#userName").send_keys(TEST_DATA["full_name"])
driver.find_element_by_css_selector("#userEmail").send_keys(TEST_DATA["email"])
driver.find_element_by_css_selector("#currentAddress").send_keys(TEST_DATA["current_address"])
driver.find_element_by_css_selector("#permanentAddress").send_keys(TEST_DATA["current_address"])
driver.find_element_by_css_selector("#submit").click()
time.sleep(2)
driver.quit()

2. Click on [Code in it] button after selecting new Category
https://testpages.herokuapp.com/styled/basic-ajax-test.html
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
driver = webdriver.Chrome()
driver.get("https://testpages.herokuapp.com/styled/basic-ajax-test.html")
list = Select(driver.find_element_by_css_selector('#combo1'))
list.select_by_value("2")
time.sleep(2)
driver.find_element_by_css_selector('.styled-click-button').click()
time.sleep(2)
driver.quit()

3. Print all text in Lorem/Ipsum/Dolor columns
https://the-internet.herokuapp.com/challenging_dom#delete
"""