Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 4, 2024 19:45
Show Gist options
  • Save SarahElson/150bf1edcf626dfd5c9b3e12d83e1605 to your computer and use it in GitHub Desktop.
Save SarahElson/150bf1edcf626dfd5c9b3e12d83e1605 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 ImplicitWait:
def __init__(self, driver):
self.driver = driver
self.driver.get("https://ecommerce-playground.lambdatest.io/")
# Ensure page load complete
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 is_email_displayed(self):
return self.driver.find_element(By.NAME, "email").is_displayed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment