-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExplicit.py
More file actions
21 lines (15 loc) · 780 Bytes
/
Explicit.py
File metadata and controls
21 lines (15 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.saucedemo.com/")
driver.find_element(By.ID, "user-name").send_keys("standard_user")
driver.find_element(By.ID, "password").send_keys("secret_sauce")
driver.find_element(By.ID, "login-button").click()
element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//button[@id='react-burger-menu-btn']")))
element.click()
element_logout = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//a[@id='logout_sidebar_link']")))
element_logout.click()
driver.quit()