Search in sources :

Example 1 with AndroidDriver

use of org.openqa.selenium.android.AndroidDriver in project Ebselen by Ardesco.

the class EbselenCore method setBrowser.

/**
     * Set the driver type based upon settings scraped from Env.properties
     * run function to get release number of website being tested
     *
     * @param driverObject - object to instantiate
     * @return WebDriver
     */
public WebDriver setBrowser(WebDriver driverObject) {
    try {
        switch(browserDetails.getBrowser()) {
            case FIREFOX:
                driverObject = new FirefoxDriver(generateFirefoxProfile());
                logger.debug("Using FIREFOX Driver...");
                break;
            case IE6:
            case IE7:
            case IE8:
            case IE9:
                driverObject = new InternetExplorerDriver();
                logger.debug("Using INTERNET EXPLORER Driver...");
                break;
            case GOOGLECHROME:
                System.setProperty("webdriver.chrome.driver", settings.chromeDriverLocation());
                driverObject = new ChromeDriver();
                logger.debug("Using GOOGLECHROME Driver...");
                break;
            case HTMLUNIT:
                driverObject = new HtmlUnitDriver(setHTMLUnitCapabilities(browserDetails.getHTMLUnitEmulation()));
                logger.debug("Using HTMLUNIT Driver...");
                break;
            case SAFARI:
                //FUTURE
                break;
            case OPERA:
                driverObject = new OperaDriver();
                logger.debug("Using Opera Driver...");
                break;
            case IPHONE:
                driverObject = new IPhoneDriver();
                logger.debug("Using IPhone Driver...");
                break;
            case ANDROID:
                driverObject = new AndroidDriver();
                logger.debug("Using Android Driver...");
                break;
        }
        getReleaseVersion();
    } catch (Exception x) {
        logger.error("Error in EbselenCore.setBrowser: {}", x.getMessage());
        return driverObject;
    }
    return driverObject;
}
Also used : OperaDriver(com.opera.core.systems.OperaDriver) IPhoneDriver(org.openqa.selenium.iphone.IPhoneDriver) AndroidDriver(org.openqa.selenium.android.AndroidDriver)

Aggregations

OperaDriver (com.opera.core.systems.OperaDriver)1 AndroidDriver (org.openqa.selenium.android.AndroidDriver)1 IPhoneDriver (org.openqa.selenium.iphone.IPhoneDriver)1