File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ self.go_back()
56
56
57
57
self .go_forward()
58
58
59
+ self .open_start_page()
60
+
59
61
self .is_element_present(selector, by = By.CSS_SELECTOR )
60
62
61
63
self .is_element_visible(selector, by = By.CSS_SELECTOR )
Original file line number Diff line number Diff line change @@ -652,6 +652,28 @@ def go_forward(self):
652
652
self .wait_for_ready_state_complete ()
653
653
self .__demo_mode_pause_if_active ()
654
654
655
+ def open_start_page (self ):
656
+ """ Navigates the current browser window to the start_page.
657
+ You can set the start_page on the command-line in three ways:
658
+ '--start_page=URL', '--start-page=URL', or '--url=URL'.
659
+ If the start_page is not set, then "data:," will be used. """
660
+ self .__check_scope ()
661
+ start_page = self .start_page
662
+ if type (start_page ) is str :
663
+ start_page = start_page .strip () # Remove extra whitespace
664
+ if start_page and len (start_page ) >= 4 :
665
+ if page_utils .is_valid_url (start_page ):
666
+ self .open (start_page )
667
+ else :
668
+ new_start_page = "http://" + start_page
669
+ if page_utils .is_valid_url (new_start_page ):
670
+ self .open (new_start_page )
671
+ else :
672
+ logging .info ('Invalid URL: "%s"!' % start_page )
673
+ self .open ("data:," )
674
+ else :
675
+ self .open ("data:," )
676
+
655
677
def is_element_present (self , selector , by = By .CSS_SELECTOR ):
656
678
self .wait_for_ready_state_complete ()
657
679
selector , by = self .__recalculate_selector (selector , by )
You can’t perform that action at this time.
0 commit comments