Ao rodar o teste, dá um erro. Mesmo atualizando o código para o gecko:
package testedesistema;
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver;
public class TesteAutomatizado { public static void main (String[] args) { WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com.br");
WebElement campoDeTexto = driver.findElement(By.name("q")); campoDeTexto.sendKeys("Caelum"); System.setProperty("webdriver.gecko.driver", "C:\Users\RebecadeSouzadosSantos\Documents\geckodriver.exe"); campoDeTexto.submit(); } }
Ele continua assim:
xception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:754)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:40)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:114)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:329)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:150)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98)
at testedesistema.TesteAutomatizado.main(TesteAutomatizado.java:10)