Automation Testing overview

 from selenium.webdriver.common.by import By

from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.support import expected_conditions as EC

class SeleniumWaitUtility:

   def __init__(self, driver, timeout):

       self.mywait = WebDriverWait(driver, timeout)

Waits for a given element to be visible

   def wait_for_element_visible(self, locator: By):

       return self.mywait.until(EC.visibility_of_element_located(locator))

Comments