-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (19 loc) · 842 Bytes
/
Copy pathmain.py
File metadata and controls
31 lines (19 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
os.environ['PATH'] += r"E:/Selenium Drivers"
driver = webdriver.Chrome()
driver.implicitly_wait(30) #time.sleep(30)
driver.get("https://www.seleniumeasy.com/test/jquery-download-progress-bar-demo.html")
my_element = driver.find_element_by_id('downloadButton')
my_element.click()
progress_element = driver.find_element_by_class_name('progress-label')
print(f"{progress_element.text == 'Completed!'}")
WebDriverWait(driver, 30).until(
EC.text_to_be_present_in_element(
(By.CLASS_NAME, 'progress-label') , # Element filtration
'Complete!'# The expected text
)
)