Skip to content

Commit fa968e6

Browse files
committed
Update the docs
1 parent 33370bb commit fa968e6

File tree

10 files changed

+67
-78
lines changed

10 files changed

+67
-78
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262

6363
--------
6464

65-
<p align="left">📓 Here's the stealthy architecture overview:</p>
65+
<h3 align="left">⚙️ Stealthy architecture flowchart:</h3>
6666

67-
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="596" alt="Stealthy architecture overview" />
67+
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="596" alt="Stealthy architecture flowchart" />
6868

6969
(For maximum stealth, use <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md">CDP Mode</a>, which includes <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md">Stealthy Playwright Mode</a>)
7070

@@ -80,6 +80,7 @@ sb = sb_cdp.Chrome(url)
8080
elements = sb.find_elements("span.titleline > a")
8181
for element in elements:
8282
print("* " + element.text)
83+
sb.driver.stop()
8384
```
8485

8586
--------
@@ -491,6 +492,7 @@ class MyTestClass(BaseCase):
491492

492493
```python
493494
self.open(url) # Navigate the browser window to the URL.
495+
self.activate_cdp_mode() # Activate CDP Mode from UC Mode.
494496
self.type(selector, text) # Update the field with the text.
495497
self.click(selector) # Click the element with the selector.
496498
self.click_link(link_text) # Click the link containing text.
@@ -579,7 +581,7 @@ pytest [FILE_NAME.py]::[CLASS_NAME]::[METHOD_NAME]
579581
pynose [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
580582
```
581583

582-
<p>✅ No More Flaky Tests! SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>). This means <b>you no longer need random <span><code translate="no">time.sleep()</code></span> statements</b> in your scripts.</p>
584+
<p>✅ No More Flaky Tests! SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>).</p>
583585
<img src="https://img.shields.io/badge/Flaky%20Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />
584586

585587
✅ SeleniumBase supports all major browsers and operating systems:

examples/cdp_mode/ReadMe.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66

77
----
88

9-
⚙️ This diagram shows the stealthy architecture with <b>CDP Mode</b>:
9+
<h3 align="left">⚙️ Stealthy architecture flowchart:</h3>
1010

11-
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="585" alt="High-Level Stealthy Architecture Overview" title="High-Level Stealthy Architecture Overview" />
11+
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="596" alt="Stealthy architecture flowchart" />
1212

1313
----
1414

15-
### 🎞️ YouTube tutorials that cover CDP Mode:
15+
### 🎞️ YouTube videos about <b translate="no">CDP Mode</b>:
1616

1717
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=Mr90iQmNsKM"><img src="https://github.com/user-attachments/assets/91e7ff7b-d155-4ba9-b17b-b097825fcf42" title="SeleniumBase on YouTube" width="320" /></a>
1818
<p>(<b><a href="https://www.youtube.com/watch?v=Mr90iQmNsKM">Watch "Undetectable Automation 4" on YouTube! ▶️</a></b>)</p>
1919

20-
(See `examples/cdp_mode/` for up-to-date examples.)
21-
2220
----
2321

2422
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=vt2zsdiNh3U"><img src="https://github.com/user-attachments/assets/82ab2715-727e-4d09-9314-b8905795dc43" title="SeleniumBase on YouTube" width="320" /></a>
@@ -27,7 +25,7 @@
2725
----
2826

2927
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ"><img src="https://github.com/user-attachments/assets/656977e1-5d66-4d1c-9eec-0aaa41f6522f" title="SeleniumBase on YouTube" width="320" /></a>
30-
<p>(<b><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ">Watch "Web-Scraping with GitHub Actions" on YouTube! ▶️</a></b>)</p>
28+
<p>(<b><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ">"Unlimited Free Web-Scraping with GitHub Actions" ▶️</a></b>)</p>
3129

3230
----
3331

help_docs/ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- SeleniumBase Docs -->
22

3-
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="330" /></a></p>
3+
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="340" /></a></p>
44

55
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> Help Docs</h2>
66

@@ -157,6 +157,6 @@
157157
--------
158158

159159
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/">
160-
<img src="https://seleniumbase.github.io/img/sb_logo_10.png" alt="SeleniumBase" width="260" />
160+
<img src="https://seleniumbase.github.io/cdn/img/nice_logo_8t.png" alt="SeleniumBase" width="340" />
161161
</a></p>
162162
<!-- View on GitHub -->

help_docs/features_list.md

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
11
<!-- SeleniumBase Docs -->
22

3-
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=EablmOazy-k"><img src="http://img.youtube.com/vi/EablmOazy-k/0.jpg" title="SeleniumBase on YouTube" width="365" /></a>
4-
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=EablmOazy-k">Watch the SeleniumBase tutorial from Selenium-Conf-2023 on YouTube</a></b>)</p>
5-
63
<a id="feature_list"></a>
74

85
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> SeleniumBase Features: 🏰</h2>
96

107
* A powerful Python framework for browser automation and E2E UI testing.
11-
* Includes [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for instantly generating browser tests in Python.
12-
* Supports multiple browsers, tabs, iframes, and proxies in the same test.
13-
* Includes [Test Case Management Software](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md) with Markdown technology.
8+
* Has [CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md) for bypassing bot-detection. (`activate_cdp_mode(url)`)
9+
* [Stealthy Playwright Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md) lets you bypass bot-detection with Playwright.
10+
* There's [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for instantly generating browser tests in Python.
11+
* Supports [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), [nose](http://nose.readthedocs.io/en/latest/), and [behave](https://behave.readthedocs.io/en/stable/index.html) for finding & running tests.
1412
* Automatic smart-waiting improves reliability and prevents flaky tests.
15-
* Supports [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), [nose](http://nose.readthedocs.io/en/latest/), and [behave](https://behave.readthedocs.io/en/stable/index.html) for finding/running tests.
1613
* All the code is open source. Look inside to learn about any feature.
1714
* Powerful logging tools for [dashboards, reports, and screenshots](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).
18-
* Can run tests in Headless Mode to hide the browser. (``--headless``)
19-
* Can run tests multithreaded from parallel browsers. (``-n NUM_THREADS``)
20-
* Can run tests from a shared browser session. (``--reuse-session``/``--rs``)
21-
* Can run tests using [Chromium's mobile device emulator](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md). (``--mobile``)
22-
* Can run tests through a proxy server. (``--proxy=IP_ADDRESS:PORT``)
23-
* Can run tests with proxy settings via PAC URL. (``--proxy-pac-url=URL.pac``)
24-
* Can run tests through an authenticated proxy server. (``--proxy=USER:PASS@HOST:PORT``)
25-
* Can run tests with proxy+auth via PAC URL. (``--proxy-pac-url=USER:PASS@URL.pac``)
26-
* Can run tests with a customized browser user agent. (``--agent=USER_AGENT_STRING``)
27-
* Can set a Chromium User Data Directory/Profile to load. (``--user-data-dir=DIR``)
28-
* Can [avoid detection](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md) by sites that try to block Selenium. (``--undetected``/``--uc``)
29-
* Can [use CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md) for advanced stealth abilities. (``activate_cdp_mode(url)``)
30-
* Can integrate with [selenium-wire](https://github.com/wkeeling/selenium-wire) for inspecting browser requests. (``--wire``)
31-
* Can load Chrome Extension ZIP files. (``--extension-zip=ZIP``)
32-
* Can load Chrome Extension folders. (``--extension-dir=DIR``)
33-
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **``seleniumbase``** or **``sbase``** to use.)
15+
* Can run tests in Headless Mode to hide the browser. (`--headless`)
16+
* Can run tests multithreaded from parallel browsers. (`-n NUM_THREADS`)
17+
* Can run tests from a shared browser session. (`--reuse-session`/`--rs`)
18+
* Can run tests using [Chromium's mobile device emulator](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md). (`--mobile`)
19+
* Can run tests through a proxy server. (`--proxy=IP_ADDRESS:PORT`)
20+
* Can run tests with proxy settings via PAC URL. (`--proxy-pac-url=URL.pac`)
21+
* Can run tests through an authenticated proxy server. (`--proxy=USER:PASS@HOST:PORT`)
22+
* Can run tests with proxy+auth via PAC URL. (`--proxy-pac-url=USER:PASS@URL.pac`)
23+
* Can run tests with a customized browser user agent. (`--agent=USER_AGENT_STRING`)
24+
* Can set a Chromium User Data Directory to load. (`--user-data-dir=DIR`)
25+
* Can load Chromium Extension folders. (`--extension-dir=DIR`)
26+
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **`seleniumbase`** or **`sbase`** to use.)
3427
* Has the ability to translate tests into [multiple spoken languages](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/translations).
3528
* Has a flexible [command-line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) for customizing test runs.
3629
* Has a [global config file](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) for configuring settings as needed.
@@ -43,19 +36,13 @@
4336
* Can handle Google Authenticator logins with [Python's one-time password library](https://pyotp.readthedocs.io/en/latest/).
4437
* Can load and make assertions on PDF files from websites or the local file system.
4538
* Can inspect HTML to find issues and points of interest with the [HTML Inspector](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/html_inspector.md).
46-
* Is backwards-compatible with Python [WebDriver](https://www.selenium.dev/projects/) methods. (Use: ``self.driver``)
47-
* Can execute JavaScript code from Python calls. (Use: ``self.execute_script()``)
48-
* Can pierce through [Shadow DOM selectors](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/shadow_dom.md). (Add ``::shadow`` to CSS fragments.)
39+
* Is backwards-compatible with Python [WebDriver](https://www.selenium.dev/projects/) methods. (Use: `self.driver`)
40+
* Can execute JavaScript code from Python calls. (Use: `self.execute_script()`)
41+
* Can pierce through [Shadow DOM selectors](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/shadow_dom.md). (Add `::shadow` to CSS fragments.)
4942
* Includes a hybrid-automation solution, [MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md), to speed up manual testing.
43+
* Includes [Test Case Management Software](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md) with Markdown technology.
5044
* Includes useful [Python decorators and password obfuscation methods](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md).
5145

5246
--------
5347

54-
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0"><img src="http://img.youtube.com/vi/yEQeAU_mrg0/0.jpg" title="SeleniumBase on YouTube" width="365" /></a>
55-
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p>
56-
57-
(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the original tutorial on YouTube</a></b>)
58-
59-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10.png" alt="SeleniumBase" title="SeleniumBase" width="240"></a></p>
60-
61-
<a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="240"></a>
48+
<a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/nice_logo_8t.png" title="SeleniumBase" width="320"></a>

help_docs/how_it_works.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66

77
👁️🔎 The primary [SeleniumBase syntax format](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md) works by extending [pytest](https://docs.pytest.org/en/latest/) as a direct plugin. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the [BaseCase class](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Tests are also given access to [SeleniumBase command-line options](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) and [SeleniumBase methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).
88

9-
👁️🔎 ``pytest`` uses a feature called test discovery to automatically find and run Python methods that start with ``test_`` when those methods are located in Python files that start with ``test_`` or end with ``_test.py``.
9+
👁️🔎 `pytest` uses a feature called test discovery to automatically find and run Python methods that start with `test_` when those methods are located in Python files that start with `test_` or end with `_test.py`/`_tests.py`.
1010

11-
👁️🔎 The primary [SeleniumBase syntax format](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md) starts by importing ``BaseCase``:
11+
👁️🔎 The primary [SeleniumBase syntax format](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md) starts by importing `BaseCase`:
1212

1313
```python
1414
from seleniumbase import BaseCase
1515
```
1616

17-
👁️🔎 This next line activates ``pytest`` when a file is called directly with ``python`` by accident:
17+
👁️🔎 This next line activates `pytest` when a file is called directly with `python` by accident:
1818

1919
```python
2020
BaseCase.main(__name__, __file__)
2121
```
2222

23-
👁️🔎 Classes can inherit ``BaseCase`` to gain SeleniumBase functionality:
23+
👁️🔎 Classes can inherit `BaseCase` to gain SeleniumBase functionality:
2424

2525
```python
2626
class MyTestClass(BaseCase):
2727
```
2828

29-
👁️🔎 Test methods inside ``BaseCase`` classes become SeleniumBase tests: (These tests automatically launch a web browser before starting, and quit the web browser after ending. Default settings can be changed via command-line options.)
29+
👁️🔎 Test methods inside `BaseCase` classes become SeleniumBase tests: (These tests automatically launch a web browser before starting, and quit the web browser after ending. Default settings can be changed via command-line options.)
3030

3131
```python
3232
class MyTestClass(BaseCase):
3333
def test_abc(self):
3434
# ...
3535
```
3636

37-
👁️🔎 [SeleniumBase APIs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md) can be called from tests via ``self``:
37+
👁️🔎 [SeleniumBase APIs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md) can be called from tests via `self`:
3838

3939
```python
4040
class MyTestClass(BaseCase):
@@ -63,7 +63,7 @@ class TestSimpleLogin(BaseCase):
6363

6464
(See the example, [test_simple_login.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_simple_login.py), for reference.)
6565

66-
👁️🔎 Here are some examples of running tests with ``pytest``:
66+
👁️🔎 Here are some examples of running tests with `pytest`:
6767

6868
```zsh
6969
pytest test_mfa_login.py
@@ -101,22 +101,22 @@ finally:
101101

102102
### ✅ No More Flaky Tests!
103103

104-
<p>SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>). This means <b>you no longer need random <span><code>time.sleep()</code></span> statements</b> in your scripts.</p>
104+
<p>SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>).</p>
105105
<img src="https://img.shields.io/badge/Flaky%20Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />
106106

107107
**There are three layers of protection that provide reliability for tests using SeleniumBase:**
108108

109-
* **(1)**: Selenium's default ``pageLoadStrategy`` is ``normal``: This strategy causes Selenium to wait for the full page to load, with HTML content and sub-resources downloaded and parsed.
109+
* **(1)**: Selenium's default `pageLoadStrategy` is `normal`: This strategy causes Selenium to wait for the full page to load, with HTML content and sub-resources downloaded and parsed.
110110

111-
* **(2)**: SeleniumBase includes methods such as ``wait_for_ready_state_complete()``, which run inside other SeleniumBase methods to ensure that it's safe to proceed with the next command.
111+
* **(2)**: SeleniumBase includes methods such as `wait_for_ready_state_complete()`, which run inside other SeleniumBase methods to ensure that it's safe to proceed with the next command.
112112

113113
* **(3)**: SeleniumBase methods automatically wait for elements to be visible and interactable before interacting with those elements.
114114

115115
**If you want to speed up your tests and you think the third level of protection is enough by itself, you can use command-line options to remove the first, the second, or both of those first two levels of protection:**
116116

117-
* ``--pls=none`` --> Set ``pageLoadStrategy`` to ``"none"``: This strategy causes Selenium to return immediately after the initial HTML content is fully received by the browser.
117+
* `--pls=none` --> Set `pageLoadStrategy` to "none": This strategy causes Selenium to return immediately after the initial HTML content is fully received by the browser.
118118

119-
* ``--sjw`` --> Skip JS Waits, such as ``wait_for_ready_state_complete()``.
119+
* `--sjw` --> Skip JS Waits, such as `wait_for_ready_state_complete()`.
120120

121121
--------
122122

help_docs/js_package_manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
🎦 (<a href="https://seleniumbase.io/help_docs/demo_mode/">Demo Mode</a>)
1010

11-
🚎 (<a href="https://seleniumbase.io/examples/tour_examples/ReadMe/">Website Tours</a>)
11+
🚎 (<a href="https://seleniumbase.io/examples/tour_examples/ReadMe/">Tour Maker</a>)
1212

1313
🎞️ (<a href="https://seleniumbase.io/examples/presenter/ReadMe/">Presentation Maker</a>)
1414

0 commit comments

Comments
 (0)