Using htmlunit webdriver

This commit is contained in:
2019-07-25 08:57:15 +02:00
parent ca010b7b25
commit 978d81bfdc
2 changed files with 18 additions and 5 deletions

View File

@@ -3,7 +3,8 @@ package org.openqa.selenium.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
@@ -12,7 +13,9 @@ public class Selenium2Example {
// Create a new instance of the Firefox driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new FirefoxDriver();
//WebDriver driver = new FirefoxDriver();
//WebDriver driver = new RemoteWebDriver(new URL("http://jenkins.fredldev.fremo-net.eu:4444/wd/hub"), capability);
WebDriver driver = new HtmlUnitDriver(true);
// And now use this to visit Google
driver.get("http://www.google.com");