Search in sources :

Example 1 with BaseSeleniumTestClass

use of org.glassfish.admingui.devtests.BaseSeleniumTestClass in project Payara by payara.

the class SeleniumHelper method getSeleniumInstance.

public SeleniumWrapper getSeleniumInstance() {
    if (selenium == null) {
        if (Boolean.parseBoolean(SeleniumHelper.getParameter("debug", "false"))) {
            logger.log(Level.INFO, "Creating new selenium instance");
        }
        String browser = getParameter("browser", "firefox");
        if ("firefox".equals(browser)) {
            driver = new FirefoxDriver();
        } else if ("chrome".equals(browser)) {
            driver = new ChromeDriver();
        } else if ("ie".contains(browser)) {
            driver = new InternetExplorerDriver();
        }
        elementFinder = new ElementFinder(driver);
        selenium = new SeleniumWrapper(driver, getBaseUrl());
        selenium.setTimeout("90000");
        // Make sure the server has started and the user logged in
        (new BaseSeleniumTestClass()).openAndWait("/", BaseSeleniumTestClass.TRIGGER_COMMON_TASKS, 480);
    }
    selenium.windowFocus();
    selenium.windowMaximize();
    selenium.setTimeout("90000");
    return selenium;
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) InternetExplorerDriver(org.openqa.selenium.ie.InternetExplorerDriver) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver) BaseSeleniumTestClass(org.glassfish.admingui.devtests.BaseSeleniumTestClass)

Aggregations

BaseSeleniumTestClass (org.glassfish.admingui.devtests.BaseSeleniumTestClass)1 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)1 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)1 InternetExplorerDriver (org.openqa.selenium.ie.InternetExplorerDriver)1