Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 4, 2024 20:02
Show Gist options
  • Save SarahElson/4e8e82f15f76c504740ae551114a29a9 to your computer and use it in GitHub Desktop.
Save SarahElson/4e8e82f15f76c504740ae551114a29a9 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 SmartWait():
def __init__(self, driver):
self.driver = driver
self.driver.get("https://ecommerce-playground.lambdatest.io/")
self.blog_link = driver.find_element(By.LINK_TEXT, "Blog")
def click_blog_link(self):
self.blog_link.click()
def click_first_post(self):
self.driver.find_element(By.TAG_NAME, "h4").click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment