Created
June 7, 2024 05:14
-
-
Save SarahElson/429a212a7d7b0f8006db0d21d175af18 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
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