mirror of
https://github.com/peter-tanner/Blackboard-marks.git
synced 2024-11-30 11:40:16 +08:00
16 lines
519 B
Python
Executable File
16 lines
519 B
Python
Executable File
from selenium.webdriver.support.wait import WebDriverWait
|
|
from selenium.webdriver.support import expected_conditions as EC
|
|
timeout = 10
|
|
|
|
|
|
def WaitClickable(driver, locator):
|
|
return WebDriverWait(driver, timeout).until(EC.element_to_be_clickable(locator))
|
|
|
|
|
|
def WaitDiv(driver, locator):
|
|
return WebDriverWait(driver, timeout).until(EC.presence_of_element_located(locator))
|
|
|
|
|
|
def SwitchToIFrame(driver, locator):
|
|
return WebDriverWait(driver, timeout).until(EC.frame_to_be_available_and_switch_to_it(locator))
|