-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2261 from seleniumbase/fix-internal-webdriver-issue
Prevent internal WebDriver issue from disrupting tests
- Loading branch information
Showing
10 changed files
with
54 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
from seleniumbase import SB | ||
|
||
with SB(uc=True, test=True) as sb: | ||
|
||
def open_the_turnstile_page(sb): | ||
sb.driver.uc_open_with_reconnect( | ||
"https://seleniumbase.io/apps/turnstile", | ||
reconnect_time=2.33, | ||
"https://seleniumbase.io/apps/turnstile", reconnect_time=2.27, | ||
) | ||
|
||
|
||
def click_turnstile_and_verify(sb): | ||
sb.driver.reconnect(0.1) | ||
iframe = sb.driver.find_element("iframe") | ||
sb.driver.reconnect(0.5) | ||
sb.driver.switch_to.frame(iframe) | ||
sb.driver.uc_click("span.mark") | ||
sb.switch_to_default_content() | ||
sb.assert_element("img#captcha-success", timeout=3.33) | ||
|
||
|
||
with SB(uc=True, test=True) as sb: | ||
open_the_turnstile_page(sb) | ||
try: | ||
click_turnstile_and_verify(sb) | ||
except Exception: | ||
open_the_turnstile_page(sb) | ||
click_turnstile_and_verify(sb) | ||
sb.set_messenger_theme(location="top_left") | ||
sb.post_message("Selenium wasn't detected!", duration=3) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# seleniumbase package | ||
__version__ = "4.21.0" | ||
__version__ = "4.21.1" |
This file contains 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