我从Selenium WebDriver和Ecplise开始。 配置Eclipse并运行简单的代码以启动网站后,出现错误。
另外添加到项目中: selenium-server-standalone-3.141.59.jar geckodriver.exe v.0.24.0 赢10 x64位 Java 1.8
Firefox版本-56.0
我已经检查了github和stackoverflow上的答案,但是其中大多数都没有完整答案或与我面临的问题不完全相关。
1550323864077 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\Tatiana\\AppData\\Local\\Temp\\rust_mozprofile.owPgCVvcxBRf"
1550323864448 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()@resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()@resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()@resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()@resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()@resource://gre/modules/AddonManager.jsm:269 < _startProvider()@resource://gre/modules/AddonManager.jsm:739 < startup()@resource://gre/modules/AddonManager.jsm:906 < startup()@resource://gre/modules/AddonManager.jsm:3090 < observe()@jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
Unable to read VR Path Registry from C:\Users\Tatiana\AppData\Local\openvr\openvrpaths.vrpath
1550323864794 Marionette INFO Enabled via --marionette
Unable to read VR Path Registry from C:\Users\Tatiana\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\Tatiana\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\Tatiana\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\Tatiana\AppData\Local\openvr\openvrpaths.vrpath
[Child 21116] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 21116] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1550323866147 Marionette INFO Listening on port 55177
[Child 24700] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 24700] WARNING: pipe[Child 2052] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 2052] WARNING: pipe errconsole.error:
Message: Error: Transaction canceled due to a closed connection.
Stack:
executeTransaction/promise<@resource://gre/modules/Sqlite.jsm:559:15
observe@resource://gre/modules/AsyncShutdown.jsm:534:9
*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping
[GPU 9072] WARNING: pipe error: 109
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
Exception in thread "main" org.openqa.selenium.NoSuchSessionException:
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'MININT-K1IIBT8', ip: '192.168.2.101', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: FirefoxDriver
remote stacktrace: WebDriverError@chrome://marionette/content/error.js:227:5
InvalidSessionIDError@chrome://marionette/content/error.js:382:5
assert.that/<@chrome://marionette/content/assert.js:383:13
assert.session@chrome://marionette/content/assert.js:49:3
execute/req<@chrome://marionette/content/server.js:536:9
TaskImpl_run@resource://gre/modules/Task.jsm:331:42
TaskImpl@resource://gre/modules/Task.jsm:280:3
asyncFunction@resource://gre/modules/Task.jsm:252:14
Task_spawn@resource://gre/modules/Task.jsm:166:12
execute@chrome://marionette/content/server.js:529:15
onPacket@chrome://marionette/content/server.js:500:7
_onJSONObjectReady/<@chrome://marionette/content/transport.js:501:9
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
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(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
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.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
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.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at Banking.main(Banking.java:27)
应该打开Firefox,并且应该打开链接 浏览器从空白窗口开始
答案 0 :(得分:-1)
此错误消息...
1550323864448 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()@resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()@resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()@resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()@resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()@resource://gre/modules/AddonManager.jsm:269 < _startProvider()@resource://gre/modules/AddonManager.jsm:739 < startup()@resource://gre/modules/AddonManager.jsm:906 < startup()@resource://gre/modules/AddonManager.jsm:3090 < observe()@jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
.
.
[Child 2052] WARNING: pipe errconsole.error:
Message: Error: Transaction canceled due to a closed connection.
Stack:
executeTransaction/promise<@resource://gre/modules/Sqlite.jsm:559:15
observe@resource://gre/modules/AsyncShutdown.jsm:534:9
*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping
[GPU 9072] WARNING: pipe error: 109
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
Exception in thread "main" org.openqa.selenium.NoSuchSessionException:
...表示 GeckoDriver 无法启动/产生新的 WebBrowser ,即 Firefox浏览器会话。
您是否使用以下任何一种都未提及:
但是,根据与类似问题和跟踪日志标题为Firefox 54.1.0 not able to launch with gecko driver (v0.18.0) in TeamCity slave machine (run as windows service) @andreastt的 GitHub 讨论清楚地提到:
我们不支持将Firefox或geckodriver作为Windows服务运行。
OP在其中运行 TeamCity 代理实例作为 Window Service 。
您还可以在Not able to run Firefox with geckodriver and jenkins slave machine as windows service
中找到相关的讨论根据以下兼容性图表,确保所使用的二进制文件相对于 GeckoDriver , Selenium 和 Firefox 是版本兼容的: / p>