Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 7, 2024 05:14
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