All Downloads are FREE. Search and download functionalities are using the official Maven repository.

driverfactory.webdriver.localdriver.EdgeDriverFactory Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.1.1
Show newest version
package driverfactory.webdriver.localdriver;

import driverfactory.webdriver.helpers.MobileEmulation;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;
import tools.properties.Properties;

import java.time.Duration;



public class EdgeDriverFactory extends DriverAbstract {

    @Override
    protected void startDriver() {
        EdgeOptions options = new EdgeOptions();
        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 EdgeDriver(options);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy