Update examples

This commit is contained in:
Michael Mintz 2024-04-11 19:05:46 -04:00
parent 7f9dba82f9
commit 9361c1c88b
5 changed files with 16 additions and 6 deletions

View File

@ -1,6 +1,5 @@
from seleniumbase import SB
with SB(uc=True, test=True, locale_code="en") as sb:
url = "https://ahrefs.com/website-authority-checker"
input_field = 'input[placeholder="Enter domain"]'

View File

@ -1,7 +1,8 @@
from seleniumbase import SB
with SB(uc=True, test=True) as sb:
sb.driver.uc_open_with_reconnect("seleniumbase.io/apps/form_turnstile", 3)
url = "seleniumbase.io/apps/form_turnstile"
sb.driver.uc_open_with_reconnect(url, 2)
sb.press_keys("#name", "SeleniumBase")
sb.press_keys("#email", "test@test.test")
sb.press_keys("#phone", "1-555-555-5555")

View File

@ -1,7 +1,7 @@
from seleniumbase import SB
with SB(uc=True, test=True) as sb:
sb.driver.uc_open_with_reconnect("nopecha.com/demo/turnstile", 3.4)
sb.driver.uc_open_with_reconnect("nopecha.com/demo/turnstile", 4)
if sb.is_element_visible("#example-container0 iframe"):
sb.switch_to_frame("#example-container0 iframe")
if not sb.is_element_visible("circle.success-circle"):

View File

@ -0,0 +1,11 @@
from seleniumbase import SB
with SB(uc=True, test=True, ad_block_on=True) as sb:
url = "https://www.thaiticketmajor.com/concert/"
sb.driver.uc_open_with_reconnect(url, 5.5)
sb.driver.uc_click("button.btn-signin", 4)
sb.switch_to_frame('iframe[title*="Cloudflare"]')
sb.assert_element("div#success svg#success-icon")
sb.switch_to_default_content()
sb.set_messenger_theme(location="top_center")
sb.post_message("SeleniumBase wasn't detected!")

View File

@ -2,9 +2,8 @@ from seleniumbase import SB
def open_the_turnstile_page(sb):
sb.driver.uc_open_with_reconnect(
"seleniumbase.io/apps/turnstile", reconnect_time=3,
)
url = "seleniumbase.io/apps/turnstile"
sb.driver.uc_open_with_reconnect(url, reconnect_time=2)
def click_turnstile_and_verify(sb):