Update example tests
This commit is contained in:
parent
f2b9448686
commit
f76d81d500
|
@ -1,4 +1,4 @@
|
|||
"""SB Manager using "uc"-mode for evading bot-detection."""
|
||||
"""SB Manager using UC Mode for evading bot-detection."""
|
||||
from seleniumbase import SB
|
||||
|
||||
with SB(uc=True) as sb:
|
||||
|
@ -8,4 +8,9 @@ with SB(uc=True) as sb:
|
|||
sb.get_new_driver(undetectable=True)
|
||||
sb.open("https://nowsecure.nl/#relax")
|
||||
sb.sleep(3)
|
||||
if not sb.is_text_visible("OH YEAH, you passed!", "h1"):
|
||||
if sb.is_element_visible('iframe[src*="challenge"]'):
|
||||
with sb.frame_switch('iframe[src*="challenge"]'):
|
||||
sb.click("area")
|
||||
sb.sleep(3)
|
||||
sb.assert_text("OH YEAH, you passed!", "h1", timeout=3)
|
||||
|
|
|
@ -35,11 +35,9 @@ class CDPTests(BaseCase):
|
|||
try:
|
||||
self.verify_success()
|
||||
except Exception:
|
||||
if self.is_element_visible('input[value*="Verify"]'):
|
||||
self.click('input[value*="Verify"]')
|
||||
elif self.is_element_visible('iframe[title*="challenge"]'):
|
||||
self.switch_to_frame('iframe[title*="challenge"]')
|
||||
self.click("span.mark")
|
||||
if self.is_element_visible('iframe[src*="challenge"]'):
|
||||
with self.frame_switch('iframe[src*="challenge"]'):
|
||||
self.click("area")
|
||||
else:
|
||||
self.fail_me()
|
||||
try:
|
||||
|
|
|
@ -25,16 +25,14 @@ class UndetectedTest(BaseCase):
|
|||
self.verify_success()
|
||||
except Exception:
|
||||
self.clear_all_cookies()
|
||||
self.get_new_driver()
|
||||
self.get_new_driver(undetectable=True)
|
||||
self.open("https://nowsecure.nl/#relax")
|
||||
try:
|
||||
self.verify_success()
|
||||
except Exception:
|
||||
if self.is_element_visible('input[value*="Verify"]'):
|
||||
self.click('input[value*="Verify"]')
|
||||
elif self.is_element_visible('iframe[title*="challenge"]'):
|
||||
self.switch_to_frame('iframe[title*="challenge"]')
|
||||
self.click("span.mark")
|
||||
if self.is_element_visible('iframe[src*="challenge"]'):
|
||||
with self.frame_switch('iframe[src*="challenge"]'):
|
||||
self.click("area")
|
||||
else:
|
||||
self.fail_me()
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue