Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 7, 2024 05:14
Show Gist options
  • Save SarahElson/429a212a7d7b0f8006db0d21d175af18 to your computer and use it in GitHub Desktop.
Save SarahElson/429a212a7d7b0f8006db0d21d175af18 to your computer and use it in GitHub Desktop.
How to Wait in Python: Python Wait Tutorial With Examples
import pytest
from selenium.webdriver.common.by import By
from pages.sleep_wait import *
import time
@pytest.mark.usefixtures("driver")
def test_sleep_wait(driver):
class_title_elements_count = 34
elements_count = SleepWait(driver)
# Python sleep method used to wait
time.sleep(5)
count = elements_count.get_elements_count()
assert count == class_title_elements_count\
, f"Expected {count} to be {class_title_elements_count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment