
driverfactory.webdriver.helpers.MobileEmulation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
An open-source Selenium Java-based Test automation Framework that allows you to perform multiple actions
to test a web application's functionality, behaviour, which provides easy to use syntax,
and easy to set up environment according to the needed requirements for testing
package driverfactory.webdriver.helpers;
import tools.properties.Properties;
import utilities.LoggingManager;
import java.util.HashMap;
import java.util.Map;
public class MobileEmulation {
private MobileEmulation() {
}
public static Map setEmulationSettings() {
Map mobileEmulation = new HashMap<>();
if(Properties.web.isCustomDevice()){
Map deviceMetrics = new HashMap<>();
deviceMetrics.put("width", Properties.web.customDeviceWidth());
deviceMetrics.put("height", Properties.web.customDeviceHeight());
deviceMetrics.put("pixelRatio", Properties.web.customDevicePixelRatio());
mobileEmulation.put("deviceMetrics", deviceMetrics);
mobileEmulation.put("userAgent",
"Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19");
LoggingManager.info("Running Mobile Emulation via Custom Device");
LoggingManager.info("Screen size: " + Properties.web.customDeviceWidth() + "x"
+ Properties.web.customDeviceHeight());
LoggingManager.info("Screen Pixel Ratio: " + Properties.web.customDevicePixelRatio());
}
else {
mobileEmulation.put("deviceName", Properties.web.deviceName());
LoggingManager.info("Running Mobile Emulation via " + Properties.web.deviceName());
}
return mobileEmulation;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy