Add an option for mobile emulation
See original GitHub issueThe problem
We often want to open browser in “mobile emulation” mode. We would like to have an option in Selenide to do it easily.
Details
Currently we have to implement own WebdriverProvider
to add this option:
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Nexus 5");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setExperimentalOption("mobileEmulation", mobileEmulation);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:28 (14 by maintainers)
Top Results From Across the Web
How to Use Mobile Emulation Mode in Chrome - SitePoint
Learn how to enable Chrome's useful device mode to emulate dozens of mobile ... a pixel ruler; add device pixel ratios; add device...
Read more >WebDriver for Chrome - Mobile Emulation
Chrome allows users to emulate Chrome on a mobile device (e.g. a “Nexus 7” tablet, or an “iPhone 5”) from the desktop version...
Read more >Simulate mobile devices with Device Mode
Use the Device Type list to simulate a mobile device or desktop device. The Device Type list. ... More options. > Add device...
Read more >How to use the mobile browser emulator in Chrome, Firefox ...
Firefox enables the Responsive Design Mode. At the top of the window, you see the parameters used by this emulation mode. If no...
Read more >How To Use Chrome's Mobile Emulation Feature To Get Your ...
The purpose of this video is to demonstrate, in simple terms, how marketers can use the Mobile Emulation Tool in Chrome Developer Tools...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have another idea.
-Dchromeoptions.args=--diagnostics,--disable-blink-features
."-Dchromeoptions.mobileEmulation=deviceName=Nexus 5"
In this case user will be able to set up any settings for mobile browser without need to change Selenide source.
@vinogradoff So, instead of one config parameter such as
headless
you should pass a lot of for device name and additional - resolution, ration and touch simulation for example. So isn’t it simpler to use custom driver provider for this case?