Created
June 4, 2024 19:54
-
-
Save SarahElson/a0ed0575dab8eecd1c0f989bac9088e6 to your computer and use it in GitHub Desktop.
How to Wait in Python: Python Wait Tutorial With Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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