Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 4, 2024 19:54
Show Gist options
  • Save SarahElson/a0ed0575dab8eecd1c0f989bac9088e6 to your computer and use it in GitHub Desktop.
Save SarahElson/a0ed0575dab8eecd1c0f989bac9088e6 to your computer and use it in GitHub Desktop.
How to Wait in Python: Python Wait Tutorial With Examples
from selenium.webdriver.common.by import By
class ExplicitWait:
def __init__(self, driver):
self.driver = driver
self.driver.get("https://ecommerce-playground.lambdatest.io/")
# Ensure complete page load
driver.set_page_load_timeout(10)
self._my_account = self.driver.find_element(By.LINK_TEXT, "My account")
def click_my_account(self):
self._my_account.click()
def get_submit_button(self):
return self.driver.find_element(By.XPATH, "//input[@type='submit']")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment