Mateus pelo que pesquisei não se coloca o Gecko Driver na lib da mesma forma que um jar pois o mesmo é um executável. Consegui colocar desta forma, porém, apresenta um novo erro conforme mensagem abaixo:
Por gentileza, consegue me ajudar?
package newAutomacao;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TesteAutomacao
{
public static void main(String[] args)
{
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Inmetrics\\Desktop\\Raquel\\Automação\\geckodriver\\geckodriver.exe");
//System.setProperty("webdriver.chrome.driver", "C:\\Users\\Inmetrics\\Desktop\\Raquel\\Automação\\Chromedriver\\chromedriver.exe");
WebDriver driver = new FirefoxDriver();
//WebDriver driver = new ChromeDriver();
driver.get("http://opensource.demo.orangehrmlive.com/");
// digita no campo com nome "q" do google
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Caelum");
// submete o form
campoDeTexto.submit();
}
}
Porém, apresenta um novo erro:
1516098628248 geckodriver INFO geckodriver 0.19.1
1516098628258 geckodriver INFO Listening on 127.0.0.1:42163
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(Ljava/util/Comparator;)Ljava/util/stream/Collector;
at org.openqa.selenium.remote.NewSessionPayload.lambda$validate$4(NewSessionPayload.java:199)
at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.openqa.selenium.remote.NewSessionPayload.validate(NewSessionPayload.java:215)
at org.openqa.selenium.remote.NewSessionPayload.<init>(NewSessionPayload.java:163)
at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:114)
at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:107)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98)
at newAutomacao.TesteAutomacao.main(TesteAutomacao.java:18)