Update the documentation

This commit is contained in:
Michael Mintz 2022-11-07 13:52:25 -05:00
parent df769dbe5b
commit 64726a17cd
9 changed files with 37 additions and 40 deletions

View File

@ -7,11 +7,9 @@
<meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
<link rel="icon" href="https://seleniumbase.github.io/img/logo3b.png" />
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_p3.png" alt="SeleniumBase" title="SeleniumBase" width="406" /></a></p>
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_p3.png" alt="SeleniumBase" title="SeleniumBase" width="382" /></a></p>
<h3 align="center"><b>All-in-one Test Automation Framework</b></h3>
<h4 align="center"><img src="https://seleniumbase.github.io/cdn/img/python_logo.png" title="SeleniumBase" width="29" /> <b>For Python enthusiasts and enterprise developers</b> <img src="https://seleniumbase.github.io/cdn/img/python_logo.png" title="SeleniumBase" width="29" /></h4>
<h3 align="center"><img src="https://seleniumbase.github.io/cdn/img/python_logo.png" title="Python" width="29" /> <b>All-in-one Test Automation Framework</b> <img src="https://seleniumbase.github.io/cdn/img/python_logo.png" title="Python" width="29" /></h3>
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a></p>
@ -20,20 +18,20 @@
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🎛️ Options</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🔮 Scripts</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🌠 Scripts</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Phone</a>
<br />
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📗 APIs</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📘 APIs</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md"> 🔡 Formats</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">⏺️ Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a>
<br />
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/commander.md">🎖️ GUI</a> |
<a href="https://seleniumbase.io/demo_page">📰 TestPage</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">🗂️ CasePlans</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/html_inspector.md">🔎 Inspector</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/html_inspector.md">🕵️ Inspector</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🧬 Hybrid</a> |
<a href="https://seleniumbase.io/devices/?url=seleniumbase.com">💻 Farm</a>
<br />

View File

@ -1,6 +1,6 @@
<!-- SeleniumBase Docs -->
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"> 🛂 Dialog Boxes 🛂</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"> Dialog Boxes 🛂</h2>
SeleniumBase Dialog Boxes let your users provide input in the middle of automation scripts.

View File

@ -15,10 +15,10 @@
<a href="https://seleniumbase.io/help_docs/syntax_formats/">🔡 Syntax Formats</a> |
<a href="https://seleniumbase.io/integrations/github/workflows/ReadMe/">🤖 CI/CD</a>
<br />
<a href="https://seleniumbase.io/help_docs/method_summary/">📗 Methods / APIs</a> |
<a href="https://seleniumbase.io/help_docs/method_summary/">📘 Methods / APIs</a> |
<a href="https://seleniumbase.io/examples/tour_examples/ReadMe/">🚎 Tours</a>
<br />
<a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/">🔮 Console Scripts</a> |
<a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/">🌠 Console Scripts</a> |
<a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/">🌐 Grid</a>
<br />
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplates</a> |
@ -27,7 +27,7 @@
<a href="https://seleniumbase.io/help_docs/js_package_manager/">🕹️ JS Manager</a> |
<a href="https://seleniumbase.io/examples/visual_testing/ReadMe/">🖼️ Visual Testing</a>
<br />
<a href="https://seleniumbase.io/help_docs/recorder_mode/">🔴 Recorder</a> |
<a href="https://seleniumbase.io/help_docs/recorder_mode/">⏺️ Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🚉 Node GUI</a>
<br />
<a href="https://seleniumbase.io/help_docs/translations/">🌏 Translator</a> |

View File

@ -1,12 +1,12 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) The HTML Inspector 🔎
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) The HTML Inspector 🕵️
🔎 <b>HTML Inspector</b> provides useful info about a web page.
🕵️ <b>HTML Inspector</b> provides useful info about a web page.
🔎 (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
🕵️ (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
🔎 Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
🕵️ Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
```python
from seleniumbase import BaseCase

View File

@ -1,15 +1,15 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Recorder Mode 🔴
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Recorder Mode ⏺️
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=eKN5nq7YbdM"><img src="http://img.youtube.com/vi/eKN5nq7YbdM/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=eKN5nq7YbdM">Watch the tutorial on YouTube</a></b>)</p>
🔴 <b>SeleniumBase Recorder Mode</b> lets you record & export browser actions into test automation scripts.<br>
⏺️ <b>SeleniumBase Recorder Mode</b> lets you record & export browser actions into test automation scripts.<br>
<img src="https://seleniumbase.github.io/cdn/img/sb_recorder_notification.png" title="SeleniumBase" width="380">
🔴 To make a new recording with Recorder Mode, use ``sbase mkrec``, ``sbase codegen``, or ``sbase record``):
⏺️ To make a new recording with Recorder Mode, use ``sbase mkrec``, ``sbase codegen``, or ``sbase record``):
```bash
sbase mkrec TEST_NAME.py --url=URL
@ -39,7 +39,7 @@ ipdb> c
*** RECORDING COPIED to: new_test.py
```
🔴 You can also activate Recorder Mode from the Recorder Desktop App:
⏺️ You can also activate Recorder Mode from the Recorder Desktop App:
```bash
sbase recorder
@ -48,13 +48,13 @@ sbase recorder
<img src="https://seleniumbase.github.io/cdn/img/recorder_desktop.png" title="SeleniumBase" width="340">
🔴 While a recording is in progress, you can press the ``[ESC]`` key to pause the Recorder. To resume the recording, you can hit the ``[~`]`` key, which is located directly below the ``[ESC]`` key on most keyboards.
⏺️ While a recording is in progress, you can press the ``[ESC]`` key to pause the Recorder. To resume the recording, you can hit the ``[~`]`` key, which is located directly below the ``[ESC]`` key on most keyboards.
🔴 From within Recorder Mode there are two additional modes: "Assert Element Mode" and "Assert Text Mode". To switch into "Assert Element Mode", press the ``[^]-key (SHIFT+6)``: The border will become purple, and you'll be able to click on elements to assert from your test. To switch into "Assert Text Mode", press the ``[&]-key (SHIFT+7)``: The border will become teal, and you'll be able to click on elements for asserting text from your test.
⏺️ From within Recorder Mode there are two additional modes: "Assert Element Mode" and "Assert Text Mode". To switch into "Assert Element Mode", press the ``[^]-key (SHIFT+6)``: The border will become purple, and you'll be able to click on elements to assert from your test. To switch into "Assert Text Mode", press the ``[&]-key (SHIFT+7)``: The border will become teal, and you'll be able to click on elements for asserting text from your test.
While using either of the two special Assertion Modes, certain actions such as clicking on links won't have any effect. This lets you make assertions on elements without navigating away from the page, etc. To add an assertion for buttons without triggering default "click" behavior, mouse-down on the button and then mouse-up somewhere else. (This prevents a detected click while still recording the assert.) To return back to the original Recorder Mode, press any key other than ``[SHIFT]`` or ``[BACKSPACE]`` (Eg: Press ``[CONTROL]``, etc.). Press ``[ESC]`` once to leave the Assertion Modes, but it'll stop the Recorder if you press it again.
🔴 For extra flexibility, the ``sbase mkrec`` command can be split into four separate commands:
⏺️ For extra flexibility, the ``sbase mkrec`` command can be split into four separate commands:
```bash
sbase mkfile TEST_NAME.py --rec
@ -68,7 +68,7 @@ cp ./recordings/TEST_NAME_rec.py ./TEST_NAME.py
The first command creates a boilerplate test with a breakpoint; the second command runs the test with the Recorder activated; the third command prints the completed test to the console; and the fourth command replaces the initial boilerplate with the completed test. If you're just experimenting with the Recorder, you can run the second command as many times as you want, and it'll override previous recordings saved to ``./recordings/TEST_NAME_rec.py``. (Note that ``-s`` is needed to allow breakpoints, unless you already have a ``pytest.ini`` file present with ``addopts = --capture=no`` in it. The ``-q`` is optional, which shortens ``pytest`` console output.)
🔴 You can also use the Recorder to add code to an existing test. To do that, you'll first need to create a breakpoint in your code to insert manual browser actions:
⏺️ You can also use the Recorder to add code to an existing test. To do that, you'll first need to create a breakpoint in your code to insert manual browser actions:
```python
import ipdb; ipdb.set_trace()
@ -80,37 +80,37 @@ Now you'll be able to run your test with ``pytest``, and it will stop at the bre
pytest TEST_NAME.py --rec -s
```
🔴 You can also set a breakpoint at the start of your test by adding ``--trace`` as a ``pytest`` command-line option: (This is useful when running Recorder Mode without any ``ipdb`` breakpoints.)
⏺️ You can also set a breakpoint at the start of your test by adding ``--trace`` as a ``pytest`` command-line option: (This is useful when running Recorder Mode without any ``ipdb`` breakpoints.)
```bash
pytest TEST_NAME.py --trace --rec -s
```
🔴 After the test completes, a file called ``TEST_NAME_rec.py`` will be automatically created in the ``./recordings`` folder, which will include the actions performed by the test, and the manual actions that you added in.
⏺️ After the test completes, a file called ``TEST_NAME_rec.py`` will be automatically created in the ``./recordings`` folder, which will include the actions performed by the test, and the manual actions that you added in.
🔴 Here's a command-line notification for a completed recording:
⏺️ Here's a command-line notification for a completed recording:
```bash
>>> RECORDING SAVED as: recordings/TEST_NAME_rec.py
***************************************************
```
🔴 When running additional tests from the same Python module, Recordings will get added to the file that was created from the first test:
⏺️ When running additional tests from the same Python module, Recordings will get added to the file that was created from the first test:
```bash
>>> RECORDING ADDED to: recordings/TEST_NAME_rec.py
***************************************************
```
🔴 Recorder Mode works by saving your recorded actions into the browser's sessionStorage. SeleniumBase then reads from the browser's sessionStorage to take the raw data and generate a full test from it. Keep in mind that sessionStorage is only present while the browser tab remains in the same domain/origin. (The sessionStorage of that tab goes away if you leave that domain/origin.) To compensate, links to web pages of different domain/origin will automatically open a new tab for you in Recorder Mode.
⏺️ Recorder Mode works by saving your recorded actions into the browser's sessionStorage. SeleniumBase then reads from the browser's sessionStorage to take the raw data and generate a full test from it. Keep in mind that sessionStorage is only present while the browser tab remains in the same domain/origin. (The sessionStorage of that tab goes away if you leave that domain/origin.) To compensate, links to web pages of different domain/origin will automatically open a new tab for you in Recorder Mode.
🔴 Additionally, the SeleniumBase <code>self.open(URL)</code> method will also open a new tab for you in Recorder Mode if the domain/origin is different from the current URL. If you need to navigate to a different domain/origin from within the same tab, call <code>self.save_recorded_actions()</code> first, which saves the recorded data for later. When a recorded test completes, SeleniumBase scans the sessionStorage data of all open browser tabs for generating the completed script.
⏺️ Additionally, the SeleniumBase <code>self.open(URL)</code> method will also open a new tab for you in Recorder Mode if the domain/origin is different from the current URL. If you need to navigate to a different domain/origin from within the same tab, call <code>self.save_recorded_actions()</code> first, which saves the recorded data for later. When a recorded test completes, SeleniumBase scans the sessionStorage data of all open browser tabs for generating the completed script.
🔴 As an alternative to activating Recorder Mode with the <code>--rec</code> command-line arg, you can also call <code>self.activate_recorder()</code> from your tests. Using the Recorder this way is only useful for tests that stay on the same URL. This is because the standard Recorder Mode functions as a Chrome extension and persists wherever the browser goes. (This version only stays on the page where called.)
⏺️ As an alternative to activating Recorder Mode with the <code>--rec</code> command-line arg, you can also call <code>self.activate_recorder()</code> from your tests. Using the Recorder this way is only useful for tests that stay on the same URL. This is because the standard Recorder Mode functions as a Chrome extension and persists wherever the browser goes. (This version only stays on the page where called.)
🔴 (Note that <b>same domain/origin</b> is not the same as <b>same URL</b>. Example: <a href="https://xkcd.com/353/" target="_blank">https://xkcd.com/353</a> and <a href="https://xkcd.com/1537/" target="_blank">https://xkcd.com/1537</a> are two different URLs with the <b>same domain/origin</b>. That means both URLs share the same sessionStorage, and that changes persist to different URLs of the same domain/origin. If you want to find out a website's origin during a test, just call: <code>self.get_origin()</code>, which returns the value of <code>window.location.origin</code> from the browser's console.)
⏺️ (Note that <b>same domain/origin</b> is not the same as <b>same URL</b>. Example: <a href="https://xkcd.com/353/" target="_blank">https://xkcd.com/353</a> and <a href="https://xkcd.com/1537/" target="_blank">https://xkcd.com/1537</a> are two different URLs with the <b>same domain/origin</b>. That means both URLs share the same sessionStorage, and that changes persist to different URLs of the same domain/origin. If you want to find out a website's origin during a test, just call: <code>self.get_origin()</code>, which returns the value of <code>window.location.origin</code> from the browser's console.)
🔴 Inside recorded tests, you might find the <code>self.open_if_not_url(URL)</code> method, which opens the URL given if the browser is not currently on that page. SeleniumBase uses this method in recorded scripts when the Recorder detects that a browser action changed the current URL. This method prevents an unnecessary page load and shows what page the test visited after a browser action.
⏺️ Inside recorded tests, you might find the <code>self.open_if_not_url(URL)</code> method, which opens the URL given if the browser is not currently on that page. SeleniumBase uses this method in recorded scripts when the Recorder detects that a browser action changed the current URL. This method prevents an unnecessary page load and shows what page the test visited after a browser action.
--------

View File

@ -96,7 +96,7 @@ nav:
- 🔮 Console Scripts: seleniumbase/console_scripts/ReadMe.md
- 🔡 Syntax Formats: help_docs/syntax_formats.md
- 🔴 Recorder Mode: help_docs/recorder_mode.md
- 📗 API Reference: help_docs/method_summary.md
- 📘 API Reference: help_docs/method_summary.md
- Python Setup / Install:
- 🐉 Get Python, pip, & git: help_docs/install_python_pip_git.md
- ⚙️ Virtualenv Instructions: help_docs/virtualenv_instructions.md
@ -143,7 +143,7 @@ nav:
- 🖥️ W3Schools Playground: https://seleniumbase.io/w3schools/
- 🖥️ W3Schools iframes: https://seleniumbase.io/w3schools/iframes
- 🗃️ W3Schools file upload: https://seleniumbase.io/w3schools/file_upload
- 🖱 W3Schools doubleclick: https://seleniumbase.io/w3schools/double_click
- 🖲 W3Schools doubleclick: https://seleniumbase.io/w3schools/double_click
- ↔️ W3Schools drag & drop: https://seleniumbase.io/w3schools/drag_drop
- ☑️ W3Schools checkboxes: https://seleniumbase.io/w3schools/checkboxes
- 🔘 W3Schools radio buttons: https://seleniumbase.io/w3schools/radio_buttons
@ -170,7 +170,7 @@ nav:
- 🗾 Locale Codes: help_docs/locale_codes.md
- Other:
- 📺 YouTube Link: https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m
- 🔎 Case Studies: help_docs/happy_customers.md
- 📋 Case Studies: help_docs/happy_customers.md
- 🙏 Thank You: help_docs/thank_you.md
# Google Analytics
extra:

View File

@ -8,7 +8,7 @@ livereload==2.6.3
joblib==1.2.0
Markdown==3.3.7
MarkupSafe==2.1.1
keyring==23.10.0
keyring==23.11.0
pkginfo==1.8.3
Jinja2==3.1.2
click==8.1.3

View File

@ -1,8 +1,8 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🔮 Console Scripts 🔮
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Console Scripts 🌠
⭐ SeleniumBase console scripts help you get things done, such as getting web drivers, creating a test directory with useful files, activating the SeleniumBase Recorder, launching the SeleniumBase Commander, translating tests into other languages, running a Selenium Grid, and more.
🌟 SeleniumBase console scripts can do many things, such as downloading web drivers, creating test directories with config files, activating the SeleniumBase Recorder, launching the SeleniumBase Commander, translating tests into other languages, running a Selenium Grid, and more.
* Usage: ``seleniumbase [COMMAND] [PARAMETERS]``

View File

@ -72,7 +72,6 @@ setup(
"Changelog": "https://github.com/seleniumbase/SeleniumBase/releases",
"Download": "https://pypi.org/project/seleniumbase/#files",
"Gitter": "https://gitter.im/seleniumbase/SeleniumBase",
"Slack": "https://app.slack.com/client/T0ABCRTNX/C01SM888REZ",
"Blog": "https://seleniumbase.com/",
"PyPI": "https://pypi.org/project/seleniumbase/",
"Source": "https://github.com/seleniumbase/SeleniumBase",