diff --git a/examples/presenter/uc_presentation.py b/examples/presenter/uc_presentation.py index ba6247cd..ae5ff4dc 100644 --- a/examples/presenter/uc_presentation.py +++ b/examples/presenter/uc_presentation.py @@ -30,12 +30,12 @@ class UCPresentationClass(BaseCase): self.get_new_driver(undetectable=True) url = "https://gitlab.com/users/sign_in" try: - self.driver.uc_open_with_reconnect(url, reconnect_time=3) + self.uc_open_with_reconnect(url, reconnect_time=3) try: self.assert_text("Username", '[for="user_login"]', timeout=3) self.post_message("SeleniumBase wasn't detected", duration=4) except Exception: - self.driver.uc_open_with_reconnect(url, reconnect_time=4) + self.uc_open_with_reconnect(url, reconnect_time=4) self.assert_text("Username", '[for="user_login"]', timeout=3) self.post_message("SeleniumBase wasn't detected", duration=4) finally: @@ -249,8 +249,7 @@ class UCPresentationClass(BaseCase): code=( "from seleniumbase import SB\n\n" "with SB(uc=True) as sb:\n" - ' sb.driver.get(' - '"https://seleniumbase.io/simple/login")\n' + ' sb.get("seleniumbase.io/simple/login")\n' ' sb.type("#username", "demo_user")\n' ' sb.type("#password", "secret_pass")\n' ' sb.click(\'a:contains("Sign in")\')\n' @@ -266,7 +265,7 @@ class UCPresentationClass(BaseCase): try: with SB(uc=True) as sb: - sb.driver.get("https://seleniumbase.io/simple/login") + sb.get("https://seleniumbase.io/simple/login") sb.type("#username", "demo_user") sb.type("#password", "secret_pass") sb.click('a:contains("Sign in")') @@ -285,7 +284,7 @@ class UCPresentationClass(BaseCase): code=( "from seleniumbase import SB\n\n" "with SB(uc=True, demo=True) as sb:\n" - ' sb.driver.get(' + ' sb.get(' '"https://seleniumbase.io/simple/login")\n' ' sb.type("#username", "demo_user")\n' ' sb.type("#password", "secret_pass")\n' @@ -301,7 +300,7 @@ class UCPresentationClass(BaseCase): try: with SB(uc=True, demo=True) as sb: - sb.driver.get("https://seleniumbase.io/simple/login") + sb.get("https://seleniumbase.io/simple/login") sb.type("#username", "demo_user") sb.type("#password", "secret_pass") sb.click('a:contains("Sign in")') @@ -340,11 +339,11 @@ class UCPresentationClass(BaseCase): code=( "from seleniumbase import SB\n\n" "with SB(uc=True) as sb:\n" - ' sb.driver.get("https://nowsecure.nl/#relax")\n' + ' sb.get("https://nowsecure.nl/#relax")\n' " sb.sleep(1)\n" ' if not sb.is_text_visible("OH YEAH, you passed", "h1"):\n' " sb.get_new_driver(undetectable=True)\n" - ' sb.driver.get("https://nowsecure.nl/#relax")\n' + ' sb.get("https://nowsecure.nl/#relax")\n' " sb.sleep(1)\n" ' sb.activate_demo_mode()\n' ' sb.assert_text("OH YEAH, you passed!", "h1", timeout=3)\n' @@ -354,10 +353,10 @@ class UCPresentationClass(BaseCase): try: with SB(uc=True) as sb: - sb.driver.uc_open_with_tab("https://nowsecure.nl/#relax") + sb.uc_open_with_tab("https://nowsecure.nl/#relax") sb.sleep(1) if not sb.is_text_visible("OH YEAH, you passed", "h1"): - sb.driver.uc_open_with_tab("https://nowsecure.nl/#relax") + sb.uc_open_with_tab("https://nowsecure.nl/#relax") sb.sleep(1) sb.activate_demo_mode() sb.assert_text("OH YEAH, you passed!", "h1", timeout=3) diff --git a/examples/presenter/uc_presentation_3.py b/examples/presenter/uc_presentation_3.py index bc428759..a3da212d 100644 --- a/examples/presenter/uc_presentation_3.py +++ b/examples/presenter/uc_presentation_3.py @@ -18,7 +18,7 @@ class UCPresentationClass(BaseCase): self.begin_presentation(filename="uc_presentation.html") self.open("https://seleniumbase.io/other/uc3_title.jpg") - self.sleep(3) + self.sleep(2.5) self.create_presentation(theme="serif", transition="fade") self.add_slide( @@ -108,11 +108,11 @@ class UCPresentationClass(BaseCase): "

Special UC Mode methods for clicking CAPTCHAs:" "


" "\n\n\n\n" @@ -171,7 +171,7 @@ class UCPresentationClass(BaseCase): "with SB(uc=True) as sb:\n" ' url = "https://gitlab.com/users/sign_in"\n' " sb.uc_open_with_reconnect(url, 4)\n" - " uc_gui_handle_captcha()\n\n" + " sb.uc_gui_handle_captcha()\n\n" " ...\n\n\n\n\n\n" ), ) @@ -183,7 +183,7 @@ class UCPresentationClass(BaseCase): "with SB(uc=True) as sb:\n" ' url = "https://gitlab.com/users/sign_in"\n' " sb.uc_open_with_reconnect(url, 4)\n" - " uc_gui_handle_captcha()\n\n" + " sb.uc_gui_handle_captcha()\n\n" ' sb.assert_text("Username", \'[for="user_login"]\',' ' timeout=3)\n' ' sb.assert_element(\'[for="user_login"]\')\n' @@ -221,7 +221,7 @@ class UCPresentationClass(BaseCase): "with SB(uc=True) as sb:\n" ' url = "https://gitlab.com/users/sign_in"\n' " sb.uc_open_with_reconnect(url, 4)\n" - " uc_gui_click_captcha()\n\n" + " sb.uc_gui_click_captcha()\n\n" " ...\n\n\n\n\n" ), ) @@ -233,7 +233,7 @@ class UCPresentationClass(BaseCase): "with SB(uc=True) as sb:\n" ' url = "https://gitlab.com/users/sign_in"\n' " sb.uc_open_with_reconnect(url, 4)\n" - " uc_gui_click_captcha()\n\n" + " sb.uc_gui_click_captcha()\n\n" ' sb.assert_text("Username", \'[for="user_login"]\',' ' timeout=3)\n' ' sb.assert_element(\'[for="user_login"]\')\n' @@ -252,8 +252,8 @@ class UCPresentationClass(BaseCase): "
  • Navigate with stealth by calling " "sb.uc_open_with_reconnect(url)" "

  • \n" - "
  • Use uc_gui_handle_captcha()" - " or uc_gui_click_captcha()" + "
  • Use sb.uc_gui_handle_captcha()" + " or sb.uc_gui_click_captcha()" " to bypass CAPTCHAs as needed.
  • \n" "\n" "


    (It's that easy!)


    \n" @@ -263,7 +263,7 @@ class UCPresentationClass(BaseCase): "

    " "