Package litmus.webdriver

Source Code of litmus.webdriver.WebDriverFactory

package litmus.webdriver;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import static java.util.concurrent.TimeUnit.SECONDS;

public class WebDriverFactory {

    private static WebDriver driver;

    public static WebDriver getWebDriver() {
        if (driver == null) {
            driver = new FirefoxDriver();
            driver.manage().timeouts().implicitlyWait(5, SECONDS);
        }
        return driver;
    }

    public static void quitAndInit() {
        if (driver != null) {
            driver.quit();
            driver = null;
        }
    }
}
TOP

Related Classes of litmus.webdriver.WebDriverFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.