Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@

--------

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

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

(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>)

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

--------
Expand Down Expand Up @@ -491,6 +492,7 @@ class MyTestClass(BaseCase):

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

<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>
<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>
<img src="https://img.shields.io/badge/Flaky%20Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />

✅ SeleniumBase supports all major browsers and operating systems:
Expand Down
24 changes: 11 additions & 13 deletions examples/cdp_mode/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@

----

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

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

----

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

<!-- 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>
<p>(<b><a href="https://www.youtube.com/watch?v=Mr90iQmNsKM">Watch "Undetectable Automation 4" on YouTube! ▶️</a></b>)</p>

(See `examples/cdp_mode/` for up-to-date examples.)

----

<!-- 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>
Expand All @@ -27,7 +25,7 @@
----

<!-- 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>
<p>(<b><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ">Watch "Web-Scraping with GitHub Actions" on YouTube! ▶️</a></b>)</p>
<p>(<b><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ">"Unlimited Free Web-Scraping with GitHub Actions" ▶️</a></b>)</p>

----

Expand Down Expand Up @@ -403,12 +401,12 @@ sb.cdp.select(selector, timeout=None)
sb.cdp.select_all(selector, timeout=None)
sb.cdp.find_elements(selector, timeout=None)
sb.cdp.find_visible_elements(selector, timeout=None)
sb.cdp.click(selector, timeout=None)
sb.cdp.click_if_visible(selector, timeout=0)
sb.cdp.click_visible_elements(selector, limit=0)
sb.cdp.click_nth_element(selector, number)
sb.cdp.click_nth_visible_element(selector, number)
sb.cdp.click_with_offset(selector, x, y, center=False)
sb.cdp.click(selector, timeout=None, scroll=True)
sb.cdp.click_if_visible(selector, timeout=0, scroll=True)
sb.cdp.click_visible_elements(selector, limit=0, scroll=True)
sb.cdp.click_nth_element(selector, number, scroll=True)
sb.cdp.click_nth_visible_element(selector, number, scroll=True)
sb.cdp.click_with_offset(selector, x, y, center=False, scroll=True)
sb.cdp.click_link(link_text)
sb.cdp.go_back()
sb.cdp.go_forward()
Expand All @@ -428,7 +426,7 @@ sb.cdp.bring_to_front()
sb.cdp.get_active_element()
sb.cdp.get_active_element_css()
sb.cdp.click_active_element()
sb.cdp.mouse_click(selector, timeout=None)
sb.cdp.mouse_click(selector, timeout=None, scroll=True)
sb.cdp.nested_click(parent_selector, selector)
sb.cdp.get_nested_element(parent_selector, selector)
sb.cdp.select_option_by_text(dropdown_selector, option)
Expand Down
4 changes: 2 additions & 2 deletions help_docs/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- SeleniumBase Docs -->

<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>
<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>

<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>

Expand Down Expand Up @@ -157,6 +157,6 @@
--------

<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/">
<img src="https://seleniumbase.github.io/img/sb_logo_10.png" alt="SeleniumBase" width="260" />
<img src="https://seleniumbase.github.io/cdn/img/nice_logo_8t.png" alt="SeleniumBase" width="340" />
</a></p>
<!-- View on GitHub -->
14 changes: 7 additions & 7 deletions help_docs/cdp_mode_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ sb.cdp.select(selector, timeout=None)
sb.cdp.select_all(selector, timeout=None)
sb.cdp.find_elements(selector, timeout=None)
sb.cdp.find_visible_elements(selector, timeout=None)
sb.cdp.click(selector, timeout=None)
sb.cdp.click_if_visible(selector)
sb.cdp.click_visible_elements(selector, limit=0)
sb.cdp.click_nth_element(selector, number)
sb.cdp.click_nth_visible_element(selector, number)
sb.cdp.click_with_offset(selector, x, y, center=False)
sb.cdp.click(selector, timeout=None, scroll=True)
sb.cdp.click_if_visible(selector, timeout=0, scroll=True)
sb.cdp.click_visible_elements(selector, limit=0, scroll=True)
sb.cdp.click_nth_element(selector, number, scroll=True)
sb.cdp.click_nth_visible_element(selector, number, scroll=True)
sb.cdp.click_with_offset(selector, x, y, center=False, scroll=True)
sb.cdp.click_link(link_text)
sb.cdp.go_back()
sb.cdp.go_forward()
Expand All @@ -54,7 +54,7 @@ sb.cdp.bring_to_front()
sb.cdp.get_active_element()
sb.cdp.get_active_element_css()
sb.cdp.click_active_element()
sb.cdp.mouse_click(selector, timeout=None)
sb.cdp.mouse_click(selector, timeout=None, scroll=True)
sb.cdp.nested_click(parent_selector, selector)
sb.cdp.get_nested_element(parent_selector, selector)
sb.cdp.select_option_by_text(dropdown_selector, option)
Expand Down
55 changes: 21 additions & 34 deletions help_docs/features_list.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
<!-- SeleniumBase Docs -->

<!-- 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>
<!-- 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>

<a id="feature_list"></a>

<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>

* A powerful Python framework for browser automation and E2E UI testing.
* Includes [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for instantly generating browser tests in Python.
* Supports multiple browsers, tabs, iframes, and proxies in the same test.
* Includes [Test Case Management Software](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md) with Markdown technology.
* Has [CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md) for bypassing bot-detection. (`activate_cdp_mode(url)`)
* [Stealthy Playwright Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md) lets you bypass bot-detection with Playwright.
* There's [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for instantly generating browser tests in Python.
* 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.
* Automatic smart-waiting improves reliability and prevents flaky tests.
* 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.
* All the code is open source. Look inside to learn about any feature.
* Powerful logging tools for [dashboards, reports, and screenshots](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).
* Can run tests in Headless Mode to hide the browser. (``--headless``)
* Can run tests multithreaded from parallel browsers. (``-n NUM_THREADS``)
* Can run tests from a shared browser session. (``--reuse-session``/``--rs``)
* Can run tests using [Chromium's mobile device emulator](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md). (``--mobile``)
* Can run tests through a proxy server. (``--proxy=IP_ADDRESS:PORT``)
* Can run tests with proxy settings via PAC URL. (``--proxy-pac-url=URL.pac``)
* Can run tests through an authenticated proxy server. (``--proxy=USER:PASS@HOST:PORT``)
* Can run tests with proxy+auth via PAC URL. (``--proxy-pac-url=USER:PASS@URL.pac``)
* Can run tests with a customized browser user agent. (``--agent=USER_AGENT_STRING``)
* Can set a Chromium User Data Directory/Profile to load. (``--user-data-dir=DIR``)
* Can [avoid detection](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md) by sites that try to block Selenium. (``--undetected``/``--uc``)
* Can [use CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md) for advanced stealth abilities. (``activate_cdp_mode(url)``)
* Can integrate with [selenium-wire](https://github.com/wkeeling/selenium-wire) for inspecting browser requests. (``--wire``)
* Can load Chrome Extension ZIP files. (``--extension-zip=ZIP``)
* Can load Chrome Extension folders. (``--extension-dir=DIR``)
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **``seleniumbase``** or **``sbase``** to use.)
* Can run tests in Headless Mode to hide the browser. (`--headless`)
* Can run tests multithreaded from parallel browsers. (`-n NUM_THREADS`)
* Can run tests from a shared browser session. (`--reuse-session`/`--rs`)
* Can run tests using [Chromium's mobile device emulator](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md). (`--mobile`)
* Can run tests through a proxy server. (`--proxy=IP_ADDRESS:PORT`)
* Can run tests with proxy settings via PAC URL. (`--proxy-pac-url=URL.pac`)
* Can run tests through an authenticated proxy server. (`--proxy=USER:PASS@HOST:PORT`)
* Can run tests with proxy+auth via PAC URL. (`--proxy-pac-url=USER:PASS@URL.pac`)
* Can run tests with a customized browser user agent. (`--agent=USER_AGENT_STRING`)
* Can set a Chromium User Data Directory to load. (`--user-data-dir=DIR`)
* Can load Chromium Extension folders. (`--extension-dir=DIR`)
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **`seleniumbase`** or **`sbase`** to use.)
* Has the ability to translate tests into [multiple spoken languages](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/translations).
* Has a flexible [command-line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) for customizing test runs.
* Has a [global config file](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) for configuring settings as needed.
Expand All @@ -43,19 +36,13 @@
* Can handle Google Authenticator logins with [Python's one-time password library](https://pyotp.readthedocs.io/en/latest/).
* Can load and make assertions on PDF files from websites or the local file system.
* 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).
* Is backwards-compatible with Python [WebDriver](https://www.selenium.dev/projects/) methods. (Use: ``self.driver``)
* Can execute JavaScript code from Python calls. (Use: ``self.execute_script()``)
* Can pierce through [Shadow DOM selectors](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/shadow_dom.md). (Add ``::shadow`` to CSS fragments.)
* Is backwards-compatible with Python [WebDriver](https://www.selenium.dev/projects/) methods. (Use: `self.driver`)
* Can execute JavaScript code from Python calls. (Use: `self.execute_script()`)
* Can pierce through [Shadow DOM selectors](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/shadow_dom.md). (Add `::shadow` to CSS fragments.)
* Includes a hybrid-automation solution, [MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md), to speed up manual testing.
* Includes [Test Case Management Software](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md) with Markdown technology.
* Includes useful [Python decorators and password obfuscation methods](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md).

--------

<!-- 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>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p>

(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the original tutorial on YouTube</a></b>)

<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>

<a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="240"></a>
<a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/nice_logo_8t.png" title="SeleniumBase" width="320"></a>
Loading