-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #2882 from seleniumbase/uc-mode-updates-and-refact…
…oring UC Mode updates and refactoring
- Loading branch information
Showing
14 changed files
with
125 additions
and
133 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
with SB(uc=True, test=True) as sb: | ||
url = "seleniumbase.io/apps/form_turnstile" | ||
sb.driver.uc_open_with_reconnect(url, 2) | ||
sb.uc_open_with_reconnect(url, 2) | ||
sb.press_keys("#name", "SeleniumBase") | ||
sb.press_keys("#email", "[email protected]") | ||
sb.press_keys("#phone", "1-555-555-5555") | ||
|
@@ -12,8 +12,8 @@ | |
sb.click('span:contains("9:00 PM")') | ||
sb.highlight_click('input[value="AR"] + span') | ||
sb.click('input[value="cc"] + span') | ||
sb.switch_to_frame("iframe") | ||
sb.driver.uc_click("span") | ||
sb.scroll_to("iframe") | ||
sb.uc_gui_handle_cf() | ||
sb.highlight("img#captcha-success", timeout=3) | ||
sb.highlight_click('button:contains("Request & Pay")') | ||
sb.highlight("img#submit-success") | ||
|
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,23 +1,9 @@ | ||
from seleniumbase import SB | ||
|
||
|
||
def open_the_turnstile_page(sb): | ||
with SB(uc=True, test=True) as sb: | ||
url = "seleniumbase.io/apps/turnstile" | ||
sb.driver.uc_open_with_reconnect(url, reconnect_time=2) | ||
|
||
|
||
def click_turnstile_and_verify(sb): | ||
sb.driver.switch_to_frame("iframe") | ||
sb.driver.uc_click("span") | ||
sb.uc_open_with_reconnect(url, reconnect_time=2) | ||
sb.uc_gui_handle_cf() | ||
sb.assert_element("img#captcha-success", timeout=3) | ||
|
||
|
||
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("SeleniumBase 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# seleniumbase package | ||
__version__ = "4.28.0" | ||
__version__ = "4.28.1" |
Oops, something went wrong.