question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an option for mobile emulation

See original GitHub issue

The 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);

See https://chromedriver.chromium.org/mobile-emulation

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:28 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
asolntsevcommented, Oct 28, 2019

I have another idea.

  1. Currently we support such a system property: -Dchromeoptions.args=--diagnostics,--disable-blink-features.
  2. We could also support similar system property: "-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.

1reaction
rosolkocommented, Oct 28, 2019

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

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found