You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.get_text(selector) # Get the text from the element.
226
+
self.get_current_url() # Get the URL of the current page.
227
+
self.get_page_source() # Get the HTML of the current page.
228
+
self.get_attribute(selector, attribute) # Get element attribute.
229
+
self.get_title() # Get the title of the current page.
230
+
self.switch_to_frame(frame) # Switch into the iframe container.
231
+
self.switch_to_default_content() # Leave the iframe container.
232
+
self.open_new_window() # Open a new window in the same browser.
233
+
self.switch_to_window(window) # Switch to the browser window.
234
+
self.switch_to_default_window() # Switch to the original window.
235
+
self.get_new_driver(OPTIONS) # Open a new driver with OPTIONS.
236
+
self.switch_to_driver(driver) # Switch to the browser driver.
237
+
self.switch_to_default_driver() # Switch to the original driver.
238
+
self.wait_for_element(selector) # Wait until element is visible.
239
+
self.is_element_visible(selector) # Return element visibility.
240
+
self.is_text_visible(text, selector) # Return text visibility.
241
+
self.sleep(seconds) # Do nothing for the given amount of time.
242
+
self.save_screenshot(name) # Save a screenshot in .png format.
243
+
self.assert_element(selector) # Verify the element is visible.
244
+
self.assert_text(text, selector) # Verify text in the element.
245
+
self.assert_title(title) # Verify the title of the web page.
246
+
self.assert_downloaded_file(file) # Verify file was downloaded.
247
+
self.assert_no_404_errors() # Verify there are no broken links.
248
+
self.assert_no_js_errors() # Verify there are no JS errors.
236
249
```
237
250
238
251
🔵 For the complete list of SeleniumBase methods, see: <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">Method Summary</a></b>
Copy file name to clipboardExpand all lines: help_docs/recorder_mode.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,14 +70,16 @@ class RecorderTest(BaseCase):
70
70
71
71
<p>🔴 SeleniumBase <code>1.66.12</code> adds the ability to instantly create a new test recording by running <code>sbase mkrec FILE.py</code>. Once the browser spins up, you can open a new web page and start performing actions that will get recorded and saved to the file you specified.</p>
72
72
73
-
<p>🔴 SeleniumBase <code>1.66.13</code> lets you add assertions for elements and text while making a recording. To add an element assertion, press the <code>[^]-key (SHIFT+6)</code>, (the border will become purple) then click on elements that you'd like to assert. To add a text assertion, press the <code>[&]-key (SHIFT+7)</code>, (the border will become orange) then click on text elements that you'd like to assert. To go back to the regular Record Mode, press any other key. While in the special assertion modes, certain actions such as clicking on links won't have any effect. This lets you make assertions on elements without certain actions getting in the way.</p>
73
+
<p>🔴 SeleniumBase <code>1.66.13</code> lets you add assertions for elements and text while making a recording. To add an element assertion, press the <code>{^}-key (SHIFT+6)</code>, (the border will become purple) then click on elements that you'd like to assert. To add a text assertion, press the <code>{&}-key (SHIFT+7)</code>, (the border will become orange) then click on text elements that you'd like to assert. To go back to the regular Record Mode, press any other key. While in the special assertion modes, certain actions such as clicking on links won't have any effect. This lets you make assertions on elements without certain actions getting in the way.</p>
74
74
75
75
<p>🔴 SeleniumBase <code>1.66.14</code> improves the algorithm for converting recorded assertions into SeleniumBase code. Text assertions that contain the newline character will now be handled correctly. If a text assertion has a <code>:contains</code> selector, then the text assertion will be changed to an element assertion. Asserted text from multi-line assertions will use <code>self.assert_text()</code> on the first non-empty line. Asserted text from single-line assertions will use <code>self.assert_exact_text()</code>. Element assertions will be handled with <code>self.assert_element()</code>.</p>
76
76
77
77
<p>🔴 SeleniumBase <code>2.0.1</code> adds the ability to preview selectors via the page title when hovering over elements. It also fixes an issue that may occur when opening up new URLs while in Recorder Mode.</p>
78
78
79
79
<p>🔴 SeleniumBase <code>2.0.2</code> fixes a bug with Recorder Mode that was preventing the last recorded assert on a domain from being saved unless it was followed by a non-assert recorded action on the same domain.</p>
80
80
81
+
<p>🔴 SeleniumBase <code>2.0.4</code> lets you go back to regular Recorder Mode from Assert Mode by pressing [ESC] once. If you press it again, it will pause the Recorder. (Previously, pressing [ESC] would pause the Recorder right away if using Assert Mode). As before, pressing the <code>{^}-key (SHIFT+6)</code> will switch the Recorder into Assert Element Mode and pressing the <code>{&}-key (SHIFT+7)</code> will switch the Recorder into Assert Text Mode. You can switch back to regular Recorder Mode from Assert Mode by pressing any key other than [SHIFT] and [BACKSPACE]. Also, <code>--codegen</code> can be used in place of <code>--recorder</code> for Recorder initialization, and <code>sbase codegen [FILE.py]</code> can be used in place of <code>sbase mkrec [FILE.py]</code>, which calls attention to the code-generation abilities of the Recorder.</p>
82
+
81
83
--------
82
84
83
85
<div>To learn more about SeleniumBase, check out the Docs Site:</div>
Copy file name to clipboardExpand all lines: help_docs/verify_webdriver.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,36 @@
1
1
## Verifying that web drivers are installed
2
2
3
-
*You can do this by checking inside a Python command prompt.*
3
+
On newer versions of SeleniumBase, the driver is automatically downloaded to the ``seleniumbase/drivers`` folder, and does not need to be on the System Path when running tests.
4
+
5
+
Drivers can be manually downloaded with commands such as:
6
+
7
+
```bash
8
+
sbase install chromedriver
9
+
sbase install chromedriver latest
10
+
sbase install geckodriver
11
+
sbase install edgedriver
12
+
```
13
+
14
+
--------
15
+
16
+
If you want to check that you have the correct driver installed on your System PATH (which is no longer necessary unless using the Selenium Grid), then continue reading below:
17
+
18
+
*This assumes you've already downloaded a driver to your **System PATH** with a command such as:*
19
+
20
+
```bash
21
+
sbase install chromedriver --path
22
+
```
23
+
24
+
(The above ``--path`` addition is for Linux/Mac only, which uses ``/usr/local/bin/``. The "Path" is different on Windows, and you'll need to manually copy the driver to your System Path, which is defined in the Control Panel's System Environment Variables.)
25
+
26
+
*You can verify that the correct drivers exist on your System Path by checking inside a Python command prompt.*
* You can run the following two commands on Mac/Linux (once you've installed SeleniumBase) to automatically upgrade your Chromedriver to match your version of Chrome: (``wget`` downloads the file, and ``pytest`` runs it.)
If you plan on using the [Selenium Grid integration](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md) (which allows for remote webdriver), you'll need to put the drivers on your System PATH. On macOS and Linux, ``/usr/local/bin`` is a good PATH spot. On Windows, you may need to set the System PATH under Environment Variables to include the location where you placed the driver files. As a shortcut, you could place the driver files into your Python ``Scripts/`` folder in the location where you have Python installed, which should already be on your System PATH.
30
37
31
38
Here's where you can go to manually install web drivers from the source:
0 commit comments