List of usage examples for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver
public FirefoxDriver()
From source file:it.pegaso2000.seleniumtester.cqatest.BaseTest.java
protected WebDriver getDriverByName(String drivername) { WebDriver drv = null;//from ww w . j a v a 2 s. com switch (drivername) { case "ff": drv = new FirefoxDriver(); break; case "ie": drv = new InternetExplorerDriver(); break; case "sf": drv = new SafariDriver(); break; case "ch": drv = new ChromeDriver(); break; default: //TODO: gestire errore driver non trovato break; } //TODO: congirare driver return drv; }
From source file:javafxapplication3.FXMLDocumentController.java
@FXML private void processButtonAction(ActionEvent event) throws AWTException, InterruptedException, IOException { WebDriver driver = new FirefoxDriver(); driver.get("http://spreadsheetpage.com/index.php/file/C35/P10/"); // sample url driver.findElement(By.xpath(".//a[@href=contains(text(),'yearly-calendar.xls')]")).click(); Robot robot = new Robot(); // Robot class throws AWT Exception Thread.sleep(2000); // Thread.sleep throws InterruptedException robot.keyPress(KeyEvent.VK_DOWN); // press arrow down key of keyboard to navigate and select Save radio button Thread.sleep(2000); // sleep has only been used to showcase each event separately robot.keyPress(KeyEvent.VK_TAB); Thread.sleep(2000);//from ww w .ja va 2 s.co m robot.keyPress(KeyEvent.VK_TAB); Thread.sleep(2000); robot.keyPress(KeyEvent.VK_TAB); Thread.sleep(2000); robot.keyPress(KeyEvent.VK_ENTER); //readXLSXFile(); //System.out.println(uploadtext.getText()); }
From source file:jdave.webdriver.specification.WebDriverSpecification.java
License:Apache License
@Override public final void create() { onBeforeCreate(); WebDriverHolder.set(new FirefoxDriver()); browser.open(); onCreate(); }
From source file:jdave.webdriver.WebDriverFactory.java
License:Apache License
public WebDriver createFireFoxDriver() { return new FirefoxDriver(); }
From source file:jenkins.plugins.testlink.examples.TestCurrentTime3.java
License:Open Source License
@Test public void testCurrentTime3() { Assert.assertNotNull(System.currentTimeMillis()); //Assert.assertTrue( System.currentTimeMillis() > 0 ); System.out.println("TestCurrentTime3 working"); //System.out.println(id); driver = new FirefoxDriver(); baseUrl = "https://trialzone.collab.net//"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get(baseUrl + "/sf/sfmain/do/home"); driver.findElement(By.id("username")).clear(); driver.findElement(By.id("username")).sendKeys("tluser"); driver.findElement(By.id("pwd")).clear(); driver.findElement(By.id("pwd")).sendKeys("Collabnet1!"); driver.findElement(By.cssSelector("strong")).click(); // Warning: verifyTextPresent may require manual changes try {// w ww . j ava 2 s . co m assertTrue(driver.findElement(By.cssSelector("BODY")).getText() .matches("^[\\s\\S]*My Workspace[\\s\\S]*$")); System.out.println("passed"); Assert.assertTrue(System.currentTimeMillis() > 0); //resultado = TestLinkAPIResults.TEST_PASSED; } catch (Error e) { System.out.println("failed"); resultado = TestLinkAPIResults.TEST_FAILED; Assert.assertFalse(System.currentTimeMillis() > 0); nota = e.getMessage(); verificationErrors.append(e.toString()); } }
From source file:jscover.server.WebDriverJasmineFireFoxTest.java
License:Open Source License
@Override public WebDriver getWebClient() { return new FirefoxDriver(); }
From source file:library.utils.WebDriverUtils.java
License:Open Source License
public WebDriver createWebDriver(String browserName, String remoteWebDriverUrl) throws MalformedURLException { LOGGER.debug("Creating [" + browserName + "] WebDriver"); WebDriver webDriver;/*from w ww . j av a2 s . co m*/ if (remoteWebDriverUrl == null) { webDriver = null; if (browserName.contains("Firefox")) { webDriver = new FirefoxDriver(); } if (browserName.contains("Chrome")) { System.setProperty("webdriver.chrome.driver", "C:\\Softwares\\chromedriver.exe"); webDriver = new ChromeDriver(); } } else { if (webDriverCache.containsKey(browserName)) { webDriver = webDriverCache.get(browserName); } else { if (BROWSER_FIREFOX.contains(browserName) || BROWSER_HTML_UNIT.contains(browserName) || BROWSER_IE.contains(browserName) || BROWSER_CHROME.contains(browserName)) { webDriver = getWebDriver(remoteWebDriverUrl, browserName); browserName = BROWSER_REMOTE.contains(browserName) ? BROWSER_REMOTE + " - " + remoteBrowserName((RemoteWebDriver) webDriver) : remoteBrowserName((RemoteWebDriver) webDriver); } else if (BROWSER_SAUCELABS.contains(browserName)) { DesiredCapabilities caps = internetExplorer(); caps.setCapability("platform", "Windows 7"); caps.setCapability("version", "11"); webDriver = new RemoteWebDriver(new URL(remoteWebDriverUrl), caps); browserName = BROWSER_REMOTE + " - " + remoteBrowserName((RemoteWebDriver) webDriver); } else { throw new IllegalArgumentException("Unable to determine the driver for [" + browserName + "]"); } LOGGER.debug("Caching [" + browserName + "] WebDriver"); webDriverCache.put(browserName, webDriver); } } return webDriver; }
From source file:limmen.hw4.view.GoogleSearchTest.java
public static void main(String... args) { WebDriver driver = new FirefoxDriver(); driver.navigate().to("http://google.com"); String appTitle = driver.getTitle(); System.out.println("Application title is :: " + appTitle); driver.quit();// w w w . j a va 2s.c om }
From source file:limmen.hw4.view.ViewTest.java
@Before public void setUp() { driver = new FirefoxDriver(); }
From source file:login.LoginOk.java
License:Open Source License
@Before public void init() { driver = new FirefoxDriver(); }