You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><imgsrc="https://seleniumbase.io/img/sb_icon.png"title="SeleniumBase"width="30" /> Mobile Testing</h2>
3
4
4
-
Use ``--mobile`` to run your SeleniumBase tests using Chrome's (or Edge's) mobile device emulator with default values for device metrics (CSS Width, CSS Height, Pixel-Ratio) and user agent.
5
+
Use ``--mobile`` to run your SeleniumBase tests using Chromium's mobile device emulator with default values for device metrics (CSS Width, CSS Height, Pixel-Ratio) and user agent.
6
+
7
+
To configure the mobile device metrics, use:
8
+
```bash
9
+
--metrics="CSS_Width,CSS_Height,Pixel_Ratio"
10
+
```
11
+
12
+
To configure the user agent, use:
13
+
```bash
14
+
--agent="USER-AGENT-STRING"
15
+
```
5
16
6
-
To configure the mobile device metrics, use ``--metrics="CSS_Width,CSS_Height,Pixel_Ratio"``. To configure the user agent, use ``--agent="USER-AGENT-STRING"``.
To find real values for device metrics, [see this GitHub Gist](https://gist.github.com/sidferreira/3f5fad525e99b395d8bd882ee0fd9d00). For a list of available user agent strings, [check out this page](https://developers.whatismybrowser.com/useragents/explore/).
Here's another example of running a mobile test (https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py), which demonstrates using ``--metrics`` and ``--agent`` with ``--mobile``:
36
+
Here's another example of running a mobile test ([SeleniumBase/examples/test_swag_labs.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py)), which demonstrates using ``--metrics`` and ``--agent`` with ``--mobile``:
22
37
23
38
```bash
24
39
# Run tests using Chrome's mobile device emulator (default settings)
0 commit comments