Skip to content

Commit d2cd00c

Browse files
committed
Update the documentation
1 parent f1354a9 commit d2cd00c

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

help_docs/mobile_testing.md

Lines changed: 25 additions & 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/) Mobile Testing
3+
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Mobile Mode / Mobile Testing
44

55
Use ``--mobile`` to run SeleniumBase tests using Chrome's mobile device emulator with default values for Device Metrics and User-Agent.
66

@@ -61,5 +61,29 @@ pytest test_swag_labs.py --mobile --agent="Mozilla/5.0 (Linux; Android 9; Pixel
6161

6262
--------
6363

64+
For some [SeleniumBase Syntax Formats](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md), you can also use `mobile=True` to run tests in Mobile Mode:
65+
66+
```python
67+
from seleniumbase import Driver
68+
69+
driver = Driver(mobile=True)
70+
try:
71+
driver.open("https://www.skype.com/en/get-skype/")
72+
driver.assert_element('[aria-label="Microsoft"]')
73+
driver.assert_text("Download Skype", "h1")
74+
driver.highlight("div.appBannerContent")
75+
driver.highlight("h1")
76+
driver.assert_text("Skype for Mobile", "h2")
77+
driver.highlight("h2")
78+
driver.highlight("#get-skype-0")
79+
driver.highlight_click("span[data-dropdown-icon]")
80+
driver.highlight("#get-skype-0_android-download")
81+
driver.highlight('[data-bi-id*="ios"]')
82+
finally:
83+
driver.quit()
84+
```
85+
86+
--------
87+
6488
<p align="center"><div align="center"><a href="https://seleniumbase.io">
6589
<img src="https://img.shields.io/badge/docs-%20seleniumbase.io-11BBDD.svg" alt="SeleniumBase.io Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/✅%20💛%20View%20Code-on%20GitHub%20🌎%20🚀-02A79E.svg" alt="SeleniumBase.io Docs" /></a></div></p>

0 commit comments

Comments
 (0)