Boa noite!
Estou na aula 1 de selenium para java, e estou enfrentando um problema ao tentar usar o selenium para abrir o firefox. Versão Firefox: 50.1.0 Segue abaixo codigo:
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) {
System.setProperty("webdriver.gecko.driver", "/home/rafael/Downloads/gecko/geckodriver");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com.br");
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Caelum");
campoDeTexto.submit();
}
}
Segue abaixo o erro apresentado:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024M; support was removed in 8.0
1508203569301 geckodriver INFO geckodriver 0.19.0
1508203569311 geckodriver INFO Listening on 127.0.0.1:18668
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'rafael-Linux', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-59-generic', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver
remote stacktrace: stack backtrace:
0: 0x4f388c - backtrace::backtrace::trace::h736111741fa0878e
1: 0x4f38c2 - backtrace::capture::Backtrace::new::h63b8a5c0787510c9
2: 0x442c61 - webdriver::error::WebDriverError::new::hc4fe6a1ced4e57dd
3: 0x443dc6 - geckodriver::marionette::MarionetteHandler::create_connection::hf8b6061dba65cdd0
4: 0x42ac91 - <webdriver::server::Dispatcher<T, U>>::run::hba9181b5aacf8f04
5: 0x402c59 - std::sys_common::backtrace::__rust_begin_short_backtrace::h19de262639927233
6: 0x40c065 - std::panicking::try::do_call::h6c1659fc4d01af51
7: 0x5e38ec - panic_unwind::__rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:98
8: 0x420d32 - <F as alloc::boxed::FnBox<A>>::call_box::h953e5f59694972c5
9: 0x5dc00b - alloc::boxed::{{impl}}::call_once<(),()>
at /checkout/src/liballoc/boxed.rs:661
- std::sys_common::thread::start_thread
at /checkout/src/libstd/sys_common/thread.rs:21
- std::sys::imp::thread::{{impl}}::new::thread_start
at /checkout/src/libstd/sys/unix/thread.rs:84
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
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:586)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:140)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98)
at TesteAutomatizado.main(TesteAutomatizado.java:10)