Skip to content

Commit 798d516

Browse files
authored
Merge pull request #4142 from seleniumbase/cdp-mode-patch-82
CDP Mode: Patch 82
2 parents c63bd7a + edf83ad commit 798d516

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+117
-59
lines changed

examples/ReadMe.md

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

3-
## [<img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Example Tests:
3+
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> Example Tests:</h2>
44

55
<p align="left"><a align="center" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"><img align="center" src="https://seleniumbase.github.io/cdn/img/sb_demo_page.png" alt="SeleniumBase Demo Page" width="420" /></a></p>
66

examples/cdp_mode/ReadMe.md

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

3-
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) CDP Mode 🐙
3+
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> CDP Mode 🐙</h2>
44

55
🐙 <b translate="no">SeleniumBase</b> <b translate="no">CDP Mode</b> is a stealth mode of SeleniumBase that uses the <a href="https://chromedevtools.github.io/devtools-protocol/" translate="no">Chrome Devtools Protocol</a> (via <a href="https://github.com/mdmintz/MyCDP" translate="no"><span translate="no">MyCDP</span></a>) to control the web browser. <b translate="no">CDP Mode</b> can be used either as a subset of <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md" translate="no"><span translate="no">SeleniumBase UC Mode</span></a></b>, or via <b><a href="#Pure_CDP_Mode" translate="no">Pure CDP Mode</a></b> (<code>sb_cdp</code>), which doesn't use WebDriver at all, and has a slightly different setup.
66

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from seleniumbase import SB
2+
3+
with SB(uc=True, test=True, mobile=True) as sb:
4+
url = "https://gitlab.com/users/sign_in"
5+
sb.activate_cdp_mode(url)
6+
sb.sleep(2)
7+
sb.solve_captcha()
8+
# (The rest is for testing and demo purposes)
9+
sb.assert_text("Username", '[for="user_login"]', timeout=3)
10+
sb.assert_element('label[for="user_login"]')
11+
sb.highlight('button:contains("Sign in")')
12+
sb.highlight('h1:contains("GitLab")')
13+
sb.post_message("SeleniumBase wasn't detected", duration=4)

examples/cdp_mode/raw_cdp_mobile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
loop.run_until_complete(
88
tab.send(
99
mycdp.emulation.set_device_metrics_override(
10-
width=411, height=731, device_scale_factor=3, mobile=True
10+
width=412, height=732, device_scale_factor=3, mobile=True
1111
)
1212
)
1313
)

examples/cdp_mode/raw_mobile_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async def main():
1010
driver = await cdp_driver.start_async()
1111
await driver.main_tab.send(
1212
mycdp.emulation.set_device_metrics_override(
13-
width=411, height=731, device_scale_factor=3, mobile=True
13+
width=412, height=732, device_scale_factor=3, mobile=True
1414
)
1515
)
1616
page = await driver.get(url, lang="en")

examples/cdp_mode/raw_mobile_gitlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
loop.run_until_complete(
1010
tab.send(
1111
mycdp.emulation.set_device_metrics_override(
12-
width=411, height=731, device_scale_factor=3, mobile=True
12+
width=412, height=732, device_scale_factor=3, mobile=True
1313
)
1414
)
1515
)

examples/cdp_mode/raw_mobile_roblox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
loop.run_until_complete(
1414
tab.send(
1515
mycdp.emulation.set_device_metrics_override(
16-
width=411, height=731, device_scale_factor=3, mobile=True
16+
width=412, height=732, device_scale_factor=3, mobile=True
1717
)
1818
)
1919
)

examples/cdp_mode/raw_stopandshop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Test Stop & Shop search. Non-US IPs might be blocked."""
22
from seleniumbase import SB
33

4-
with SB(uc=True, test=True, guest=True, ad_block=True) as sb:
4+
with SB(uc=True, test=True, ad_block=True) as sb:
55
url = "https://stopandshop.com/"
66
sb.activate_cdp_mode(url)
77
sb.sleep(2.6)

examples/chart_maker/ReadMe.md

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

3-
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📊 ChartMaker 📶
3+
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> 📊 ChartMaker 📶</h2>
44

55
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts.</p>
66

examples/presenter/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-
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📑 Presenter 🎞️
3+
<h2><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"></a> 📑 Presenter 🎞️</h2>
44

55
<p>SeleniumBase Presenter (slide-maker) lets you use Python to generate HTML presentations.</p>
66

@@ -21,7 +21,7 @@ cd examples/presenter
2121
pytest my_presentation.py
2222
```
2323

24-
**Here's a presentation with a chart:**
24+
<b>Here's a presentation with a chart:</b>
2525

2626
<a href="https://seleniumbase.github.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.github.io/other/sb_core_areas.png" title="Screenshot"></a><br>
2727

0 commit comments

Comments
 (0)