@@ -72,21 +72,21 @@ pytest my_first_test.py --browser=chrome
72
72
self .open(URL ) # Navigate to the web page
73
73
self .click(SELECTOR ) # Click a page element
74
74
self .update_text(SELECTOR , TEXT ) # Type text (Add "\n" to text for pressing enter/return.)
75
- self .assert_element(SELECTOR ) # Assert element on the page
76
- self .assert_text(TEXT ) # Assert text on the page (has optional SELECTOR arg)
75
+ self .assert_element(SELECTOR ) # Assert element is visible
76
+ self .assert_text(TEXT ) # Assert text is visible (has optional SELECTOR arg)
77
77
self .assert_title(PAGE_TITLE ) # Assert page title
78
78
self .assert_no_404_errors() # Assert no 404 errors from files on the page
79
- self .assert_no_js_errors() # Assert no JavaScript errors on page (Chrome-ONLY)
79
+ self .assert_no_js_errors() # Assert no JavaScript errors on the page (Chrome-ONLY)
80
80
self .execute_script(JAVASCRIPT ) # Execute javascript code
81
81
self .go_back() # Navigate to the previous URL
82
82
self .get_text(SELECTOR ) # Get text from a selector
83
83
self .get_attribute(SELECTOR , ATTRIBUTE ) # Get a specific attribute from a selector
84
84
self .is_element_visible(SELECTOR ) # Find out if an element is visible on the page
85
- self .is_text_visible(TEXT ) # Find out if specific text is visible on the page (has optional SELECTOR arg)
85
+ self .is_text_visible(TEXT ) # Find out if specific text is visible on the page (optional SELECTOR arg)
86
86
self .hover_and_click(HOVER_SELECTOR , CLICK_SELECTOR ) # Mouseover an element and click another element
87
87
self .select_option_by_text(DROPDOWN_SELECTOR , OPTION_TEXT ) # Select a dropdown option
88
88
self .switch_to_frame(FRAME_NAME ) # Switch webdriver control to an iframe on the page
89
- self .switch_to_default_content() # Switch webdriver control out of the current iframe to the page
89
+ self .switch_to_default_content() # Switch webdriver control out of the current iframe
90
90
self .switch_to_window(WINDOW_NUMBER ) # Switch to a different window/tab
91
91
self .save_screenshot(FILE_NAME ) # Save a screenshot of the current page
92
92
```
@@ -517,10 +517,10 @@ if self.is_element_visible('div#warning'):
517
517
is_element_present(selector) # is an element present on a page
518
518
``` python
519
519
if self .is_element_present(' div#top_secret img.tracking_cookie' ):
520
- self .contact_cookie_monster() # Not a real method unless you define it somewhere
520
+ self .contact_cookie_monster() # Not a real SeleniumBase method
521
521
else :
522
522
current_url = self .get_current_url()
523
- self .contact_the_nsa(url = current_url, message = " Dark Zone Found" ) # Not a real method unless you define it somewhere
523
+ self .contact_the_nsa(url = current_url, message = " Dark Zone Found" ) # Not a real SeleniumBase method
524
524
```
525
525
Another example:
526
526
``` python
0 commit comments