6666from seleniumbase import sb_cdp
6767
6868sb = sb_cdp.Chrome()
69- sb.open (" https://browserscan.net/bot-detection" )
69+ sb.goto (" https://browserscan.net/bot-detection" )
7070sb.sleep(3 )
7171sb.quit()
7272```
@@ -105,7 +105,7 @@ with sync_playwright() as p:
105105from seleniumbase import sb_cdp
106106
107107sb = sb_cdp.Chrome(locale = " en" , ad_block = True )
108- sb.open (" https://browserscan.net/bot-detection" )
108+ sb.goto (" https://browserscan.net/bot-detection" )
109109sb.flash(" Test Results" , duration = 1.5 , pause = 0.5 )
110110sb.assert_element(' strong:contains("Normal")' )
111111print (" Bot Not Detected" )
@@ -242,7 +242,7 @@ BaseCase.main(__name__, __file__) # Call pytest
242242
243243class MyTestClass (BaseCase ):
244244 def test_swag_labs (self ):
245- self .open (" https://www.saucedemo.com" )
245+ self .goto (" https://www.saucedemo.com" )
246246 self .type(" #user-name" , " standard_user" )
247247 self .type(" #password" , " secret_sauce\n " )
248248 self .assert_element(" div.inventory_list" )
@@ -362,7 +362,7 @@ BaseCase.main(__name__, __file__)
362362
363363class TestSimpleLogin (BaseCase ):
364364 def test_simple_login (self ):
365- self .open (" seleniumbase.io/simple/login" )
365+ self .goto (" seleniumbase.io/simple/login" )
366366 self .type(" #username" , " demo_user" )
367367 self .type(" #password" , " secret_pass" )
368368 self .click(' a:contains("Sign in")' )
@@ -379,7 +379,7 @@ class TestSimpleLogin(BaseCase):
379379from seleniumbase import SB
380380
381381with SB() as sb:
382- sb.open (" seleniumbase.io/simple/login" )
382+ sb.goto (" seleniumbase.io/simple/login" )
383383 sb.type(" #username" , " demo_user" )
384384 sb.type(" #password" , " secret_pass" )
385385 sb.click(' a:contains("Sign in")' )
@@ -397,7 +397,7 @@ from seleniumbase import Driver
397397
398398driver = Driver()
399399try :
400- driver.open (" seleniumbase.io/simple/login" )
400+ driver.goto (" seleniumbase.io/simple/login" )
401401 driver.type(" #username" , " demo_user" )
402402 driver.type(" #password" , " secret_pass" )
403403 driver.click(' a:contains("Sign in")' )
@@ -549,7 +549,7 @@ BaseCase.main(__name__, __file__)
549549
550550class MyTestClass(BaseCase):
551551 def test_swag_labs(self):
552- self.open (" https://www.saucedemo.com" )
552+ self.goto (" https://www.saucedemo.com" )
553553 self.type(" #user-name" , " standard_user" )
554554 self.type(" #password" , " secret_sauce\n" )
555555 self.assert_element(" div.inventory_list" )
@@ -582,7 +582,8 @@ class MyTestClass(BaseCase):
582582< h3><img src=" https://seleniumbase.github.io/img/logo7.png" title=" SeleniumBase" width=" 32" /> Here are some common SeleniumBase methods:< /h3>
583583
584584` ` ` python
585- self.open(url) # Navigate the browser window to the URL.
585+ self.goto(url) # Navigate the browser window to the URL.
586+ self.open(url) # Same as ` self.goto(url)`
586587self.activate_cdp_mode () # Activate CDP Mode from UC Mode.
587588self.type(selector, text) # Update the field with the text.
588589self.click(selector) # Click the element with the selector.
@@ -958,7 +959,7 @@ BaseCase.main(__name__, __file__)
958959class MyTestClass(BaseCase):
959960
960961 def test_find_army_of_robots_on_xkcd_desert_island(self):
961- self.open (" https://xkcd.com/731/" )
962+ self.goto (" https://xkcd.com/731/" )
962963 self.assert_element(" div#ARMY_OF_ROBOTS" , timeout=1) # This should fail
963964` ` `
964965
@@ -1162,7 +1163,7 @@ pytest [YOUR_TEST_FILE.py] --with-db-reporting --with-s3-logging
11621163🔵 ** Navigating to a web page: (and related commands)**
11631164
11641165` ` ` python
1165- self.open (" https://xkcd.com/378/" ) # This method opens the specified page.
1166+ self.goto (" https://xkcd.com/378/" ) # This method opens the specified page.
11661167
11671168self.go_back() # This method navigates the browser to the previous page.
11681169
@@ -1299,7 +1300,7 @@ def is_there_a_cloaked_klingon_ship_on_this_page():
12991300
13001301` ` ` python
13011302if self.is_text_visible(" You Shall Not Pass!" , " h1" ):
1302- self.open (" https://www.youtube.com/watch?v=3xYXUeSmb-Y" )
1303+ self.goto (" https://www.youtube.com/watch?v=3xYXUeSmb-Y" )
13031304` ` `
13041305
13051306< div></div>
@@ -1444,7 +1445,7 @@ self.execute_script("return jQuery('textarea')[2].value") # Returns the css "va
14441445` ` ` python
14451446start_page = " https://xkcd.com/465/"
14461447destination_page = " https://github.com/seleniumbase/SeleniumBase"
1447- self.open (start_page)
1448+ self.goto (start_page)
14481449referral_link = '''<a class='analytics test' href='%s'>Free-Referral Button!</a>''' % destination_page
14491450self.execute_script('''document.body.innerHTML = \" %s\" ''' % referral_link)
14501451self.click(" a.analytics" ) # Clicks the generated button
@@ -1464,7 +1465,7 @@ BaseCase.main(__name__, __file__)
14641465
14651466class DeferredAssertTests(BaseCase):
14661467 def test_deferred_asserts(self):
1467- self.open ("https://xkcd.com/993/")
1468+ self.goto ("https://xkcd.com/993/")
14681469 self.wait_for_element("#comic")
14691470 self.deferred_assert_element(' img[alt= " Brand Identity" ]' )
14701471 self.deferred_assert_element(' img[alt= " Rocket Ship" ]' ) # Will Fail
0 commit comments