Skip to content

Commit d028e3b

Browse files
committedFeb 13, 2025
Update examples
1 parent 32960b6 commit d028e3b

8 files changed

+11
-11
lines changed
 

‎examples/boilerplates/samples/google_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .google_objects import HomePage, ResultsPage
55
except Exception:
66
from google_objects import HomePage, ResultsPage
7-
BaseCase.main(__name__, __file__)
7+
BaseCase.main(__name__, __file__, "--uc")
88

99

1010
class GoogleTests(BaseCase):

‎examples/boilerplates/samples/test_page_objects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""An example using the Classic Page Object Model."""
22
from seleniumbase import BaseCase
3-
BaseCase.main(__name__, __file__)
3+
BaseCase.main(__name__, __file__, "--uc")
44

55

66
class GooglePage:

‎examples/cdp_mode/raw_priceline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
sb.sleep(0.8)
2828
for y in range(1, 9):
2929
sb.scroll_to_y(y * 400)
30-
sb.sleep(1.25)
30+
sb.sleep(0.75)
3131
hotel_names = sb.find_elements('a[data-autobot-element-id*="HOTEL_NAME"]')
3232
hotel_prices = sb.find_elements('span[font-size="4,,,5"]')
3333
print("Priceline Hotels in %s:" % location)

‎examples/presenter/uc_presentation_4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def test_presentation_4(self):
796796
sb.sleep(0.8)
797797
for y in range(1, 9):
798798
sb.scroll_to_y(y * 400)
799-
sb.sleep(1.25)
799+
sb.sleep(0.75)
800800
hotel_names = sb.find_elements(
801801
'a[data-autobot-element-id*="HOTEL_NAME"]'
802802
)

‎examples/raw_google.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from seleniumbase import SB
22

3-
with SB(test=True) as sb:
3+
with SB(test=True, uc=True) as sb:
44
sb.open("https://google.com/ncr")
55
sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
66
sb.click('[href*="github.com/seleniumbase/"]')

‎examples/raw_gui_click.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22
from seleniumbase import SB
33

4-
# An incomplete UserAgent forces CAPTCHA-solving on macOS
5-
agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/126.0.0.0"
4+
# An bad UserAgent forces CAPTCHA-solving on macOS
5+
agent = "cool"
66
if "linux" in sys.platform or "win32" in sys.platform:
77
agent = None # Use the default UserAgent
88

‎examples/raw_pyautogui.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22
from seleniumbase import SB
33

4-
# An incomplete UserAgent forces CAPTCHA-solving on macOS
5-
agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/126.0.0.0"
4+
# An bad UserAgent forces CAPTCHA-solving on macOS
5+
agent = "cool"
66
if "linux" in sys.platform or "win32" in sys.platform:
77
agent = None # Use the default UserAgent
88

‎examples/test_cdp_ad_blocking.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
class CDPNetworkBlockingTests(BaseCase):
66
def test_cdp_network_blocking(self):
77
self.open("about:blank")
8-
if not self.is_chromium():
9-
message = "This test is only for Chromium browsers!"
8+
if self._reuse_session or not self.is_chromium():
9+
message = "Skipping test if reusing session or not Chromium!"
1010
print(message)
1111
self.skip(message)
1212
self.execute_cdp_cmd(

0 commit comments

Comments
 (0)
Please sign in to comment.