Система
- Версия GeckoDriver: 0.24.0
- Платформа: Window 10
- Firefox: 65.0
- Селен: 3.141.59
Тестовый случай
Когда я запускаю драйвер Firefox
, в первый раз происходит сбой, после которого он работает нормально при каждом запуске.
Это происходит следующим образомспособ:
- Если я использую автономный сервер selenium, при каждом перезапуске сервера selenium.
- При каждом перезапуске моей машины
- Если я используюСелен автономный сервер и пытается запустить несколько потоков с несколькими браузерами одновременно, все браузеры работают хорошо, кроме Firefox, это может быть сбой при любом запуске.
Stacktrace
org.openqa.selenium.WebDriverException: connection refused
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'SAURABH-PC', ip: '192.168.3.8', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version:
'1.8.0_161'
Driver info: driver.version: unknown
remote stacktrace:
Command duration or timeout: 66.09 seconds
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.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
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:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
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.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:252)
Код
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:49153/wd/hub"), capabilities);
Команда для запуска Selenium-standalone.jar
java -Dwebdriver.gecko.driver=<path-to-geckodriver>\geckodriver.exe -jar <path-to-selenium-server-standalone.jar>\selenium-server-standalone.jar -port 49153
Журналы уровня трассировки
Feb 06, 2019 6:29:24 PM org.openqa.selenium.remote.DesiredCapabilities firefox
INFO: Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
Feb 06, 2019 6:29:44 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
"value":{"error":"unknown error","message":"connection refused","stacktrace":""}}
1549457898669 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\Saurabh\\AppData\\Local\\Temp\\rust_mozprofile.2UOp20Lx725Q"
1549457899002 geckodriver::marionette DEBUG Waiting 60s to connect to browser on 127.0.0.1:51325
1549457915749 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: resource://pdf.js/
1549457915749 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: about:reader*
1549457916114 Marionette TRACE Received observer notification profile-after-change
1549457917888 Marionette TRACE Received observer notification toplevel-window-ready
1549457918713 Marionette TRACE Received observer notification command-line-startup
1549457918714 Marionette TRACE Received observer notification nsPref:changed
1549457918714 Marionette DEBUG Init aborted (running=false, enabled=true, finalUIStartup=false)
1549457925550 Marionette TRACE Received observer notification toplevel-window-ready
1549457948093 Marionette TRACE Received observer notification sessionstore-windows-restored
1549457948093 Marionette TRACE Waiting until startup recorder finished recording startup scripts...
1549457959572 mozrunner::runner DEBUG Killing process 11516
Exiting due to channel error.
Exiting due to channel error.
1549457960997 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unknown error","message":"connection refused","stacktrace":""}}
1549457965775 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\Saurabh\\AppData\\Local\\Temp\\rust_mozprofile.0d9kqn5LP57h"
1549457965997 geckodriver::marionette DEBUG Waiting 60s to connect to browser on 127.0.0.1:51620
1549457995244 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: resource://pdf.js/
1549457995245 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: about:reader*
1549457995902 Marionette TRACE Received observer notification profile-after-change
1549457998402 Marionette TRACE Received observer notification toplevel-window-ready
1549457998814 Marionette TRACE Received observer notification command-line-startup
1549457998814 Marionette TRACE Received observer notification nsPref:changed
1549457998814 Marionette DEBUG Init aborted (running=false, enabled=true, finalUIStartup=false)