Untitled
unknown
plain_text
a year ago
573 B
17
Indexable
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class BasePage:
def __init__(self, driver):
self.driver = driver
self.wait = WebDriverWait(self.driver, 5)
def is_visible(self, by_locator):
try:
element = self.wait.until(EC.visibility_of_element_located(by_locator))
return bool(element)
except:
return False
def click_element(self, by_locator):
self.wait.until(EC.element_to_be_clickable(by_locator)).click()
Editor is loading...
Leave a Comment