List of usage examples for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver
public FirefoxDriver()
From source file:com.davidgaskins.learningtounittest.MoneyMaker.java
License:Apache License
public MoneyMaker() { driver = new FirefoxDriver(); }
From source file:com.demo.presentation.PresentacionActualizacionTest.java
@BeforeClass public static void setUpClass() { driver = new FirefoxDriver(); baseUrl = "http://localhost:8084/"; driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get(baseUrl + "/bank-crud-jsf2/pages/register.jsf"); try {/*from w w w . j a v a 2 s . co m*/ revertChanges(); } catch (InterruptedException ex) { Logger.getLogger(PresentacionActualizacionTest.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.denimgroup.threadfix.selenium.tests.BaseTest.java
License:Mozilla Public License
public BaseTest(String browser) { if (browser.equals("chrome")) { String location = BaseTest.class.getClassLoader().getResource("Drivers").getFile(); String log = ""; if (System.getProperty("os.name").startsWith("Windows")) { location = location + "/chromedriver.exe"; log = "NUL"; } else {// w w w.j ava 2 s. c om location = location + "/chromedriver"; log = "/dev/null"; } service = new ChromeDriverService.Builder().usingDriverExecutable(new File(location)).usingAnyFreePort() .withLogFile(new File(log)).build(); try { service.start(); } catch (IOException e) { e.printStackTrace(); } driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome()); } if (browser.equals("firefox")) { driver = new FirefoxDriver(); } if (browser.equals("IE")) { String location = BaseTest.class.getClassLoader().getResource("Drivers").getFile(); location = location + "/IEDriverServer.exe"; DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); driver = new InternetExplorerDriver(capabilities); } }
From source file:com.deque.axe.ExampleTest.java
License:Mozilla Public License
/** * Instantiate the WebDriver and navigate to the test site *//* w w w. j ava 2 s. com*/ @Before public void setUp() { driver = new FirefoxDriver(); driver.get("http://localhost:5005"); }
From source file:com.ecfeed.core.runner.java.SeleniumTestMethodInvoker.java
License:Open Source License
private void setDriverIntr(String browserName, String driverPath, MethodParameterNode methodParameterNode) { if (StringHelper.isEqualIgnoreCase(browserName, NodePropertyDefs.browserNameChrome())) { System.setProperty("webdriver.chrome.driver", driverPath); fDriver = new ChromeDriver(); return;/* w w w.j av a2s .c o m*/ } if (StringHelper.isEqualIgnoreCase(browserName, NodePropertyDefs.browserNameFirefox())) { System.setProperty("webdriver.gecko.driver", driverPath); fDriver = new FirefoxDriver(); return; } if (StringHelper.isEqualIgnoreCase(browserName, NodePropertyDefs.browserNameIExplorer())) { System.setProperty("webdriver.ie.driver", driverPath); fDriver = new InternetExplorerDriver(); return; } if (StringHelper.isEqualIgnoreCase(browserName, NodePropertyDefs.browserNameOpera())) { System.setProperty("webdriver.opera.driver", driverPath); fDriver = new OperaDriver(); return; } if (StringHelper.isEqualIgnoreCase(browserName, NodePropertyDefs.browserNameSafari())) { fDriver = new SafariDriver(); return; } reportException("WebDriver is not supported: " + browserName + ".", methodParameterNode); }
From source file:com.esri.qa.test.FormRequestAFreeTrial.java
@BeforeMethod public void setUp() { driver = new FirefoxDriver(); // open firefox driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); driver.get(FreeTrialurl);//from w w w. j a v a 2 s. c om driver.manage().window().maximize(); }
From source file:com.esri.qa.test.MiscPageSoftLicense.java
@BeforeMethod public void setUp() { driver = new FirefoxDriver(); // open firefox driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); driver.get(SoftwareLicenceURL);//from w w w .j a v a2s .c o m driver.manage().window().maximize(); }
From source file:com.evolveum.midpoint.selenium.BaseTest.java
License:Apache License
@BeforeClass(alwaysRun = true) public void beforeClass(ITestContext context) { siteUrl = context.getCurrentXmlTest().getParameter(PARAM_SITE_URL); int wait = getTimeoutParameter(context, PARAM_TIMEOUT_WAIT, 1); int page = getTimeoutParameter(context, PARAM_TIMEOUT_PAGE, 1); int script = getTimeoutParameter(context, PARAM_TIMEOUT_SCRIPT, 1); LOGGER.info("Site url: '{}'. Timeouts: implicit wait({}), page load ({}), script({})", new Object[] { siteUrl, wait, page, script }); driver = new FirefoxDriver(); WebDriver.Timeouts timeouts = driver.manage().timeouts(); timeouts.implicitlyWait(wait, TimeUnit.SECONDS); timeouts.pageLoadTimeout(page, TimeUnit.SECONDS); timeouts.setScriptTimeout(script, TimeUnit.SECONDS); }
From source file:com.example.HelloWorldIntegrationTest.java
License:Apache License
@BeforeClass public static void initWebDriver() { driver = new FirefoxDriver(); }
From source file:com.example.selenium.action.DoubleClick.java
@BeforeTest public void setup() { driver = new FirefoxDriver(); driver.get("http://localhost:8080/WebApplication/pages/doubleclick.html"); }