xframium / xframium-java

xFramium - Rapid unified test case development
http://www.xframium.org
GNU General Public License v3.0
12 stars 18 forks source link

support for mobile emulation in chrome browser #43

Closed xframiumAS closed 7 years ago

xframiumAS commented 7 years ago

in chrome options factory, change the below condition from else if to else else if(name.equalsIgnoreCase("prefs"))

xframiumAS commented 7 years ago

The mobile emulation is added to chrome options as per the below code Map<String, String> mobileEmulation = new HashMap<String, String>(); mobileEmulation.put("deviceName", "Google Nexus 5");

Map<String, Object> chromeOptions = new HashMap<String, Object>(); chromeOptions.put("mobileEmulation", mobileEmulation); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);

Our deviceRegistry supports objectcapability where this option can be passed as

Google Nexus 5

To support this type of formats the code in ChromeOptionsFactory has to be changed from else if(name.equalsIgnoreCase("prefs")) to else statement

xframium commented 7 years ago

resolved in 1.0.6