
driverfactory.webdriver.localdriver.ChromeDriverFactory 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.localdriver;
import driverfactory.webdriver.helpers.MobileEmulation;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import tools.properties.Properties;
import tools.properties.Properties;
import java.time.Duration;
public class ChromeDriverFactory extends DriverAbstract {
@Override
protected void startDriver() {
ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
options.addArguments("--log-level=SEVERE");
options.addArguments("--enable-logging");
options.addArguments("--" + Properties.web.executionMethod(), "--window-size=1920,1080");
options.setScriptTimeout(Duration.ofSeconds(Properties.timeouts.scriptTimeout()));
options.setPageLoadTimeout(Duration.ofSeconds(Properties.timeouts.pageLoadTimeout()));
if(Properties.web.isMobileEmulation()){
options.setExperimentalOption("mobileEmulation", MobileEmulation.setEmulationSettings());
}
if(!Properties.executionOptions.proxySettings().isEmpty()){
Proxy proxy = new Proxy();
proxy.setHttpProxy(Properties.executionOptions.proxySettings());
proxy.setSslProxy(Properties.executionOptions.proxySettings());
options.setProxy(proxy);
}
driver = new ChromeDriver(options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy