1

我第一次尝试使用 Edge 驱动程序,但在使用 RemoteWebDriver 时无法导航到 URL。浏览器打开但它停留在“空白页”上,在网格节点上生成以下错误......

17:24:05.348 INFO - Executing: [new session: Capabilities [{acceptSslCerts=true, browserName=MicrosoftEdge, javascriptEnabled=true, ignoreProtectedModeSettings=true, version=, platform=WINDOWS}]])
17:24:05.372 INFO - Creating a new session for Capabilities [{acceptSslCerts=true, browserName=MicrosoftEdge, javascriptEnabled=true, ignoreProtectedModeSettings=true, version=, platform=WINDOWS}]
[17:24:05.453] - Listening on http://localhost:24558/
17:24:06.020 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'SAL-36', ip: '192.168.0.12', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
        at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
        at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
        at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:131)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:36)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
        at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:190)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:222)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:184)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:150)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
        at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:543)
        at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
        at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1228)
        at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
        at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:481)
        at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
        at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1130)
        at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
        at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:320)
        at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
        at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
        at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:112)
        at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
        at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:122)
        at org.seleniumhq.jetty9.util.thread.strategy.ExecutingExecutionStrategy.invoke(ExecutingExecutionStrategy.java:58)
        at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:201)
        at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:133)
        at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
        at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'

当使用常规 EdgeDriver 而不是 RemoteWebDriver 时,它可以正常工作。

这是我的节点文件...

java -jar "C:\Selenium\Grid\selenium-server-standalone-3.4.0.jar" -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=5 -browser browserName=chrome,platform=WIN10,maxInstances=5 -browser browserName="internet explorer",platform=WIN10,maxInstances=5 -browser browserName="MicrosoftEdge",platform=WINDOWS,maxInstances=1 -port 5555 

我的所有网络驱动程序都在我机器上的同一目录中 -C:\Selenium\Webdrivers并且该文件夹有一个环境变量

我在用.....

  • selenium 3.0.1 nuget 包(RemoteWebDriver 在 3.4.0 中不起作用)
  • 边缘驱动程序版本 15063
  • 边缘版本 40.15063.0.0
  • 操作系统版本 15063.413

所有其他 WebDriver 目前都在 selenium 网格中工作。

如果有人能够提供帮助,我将永远感激不尽

4

1 回答 1

0

正如此答案中所解释的,已知 Edge 与其他浏览器位于同一节点会导致此类问题。解决方法是在同一台机器上启动 2 个单独的节点:一个仅用于 Edge,第二个用于 IE、FF 和 Chrome。

于 2017-08-10T20:59:52.170 回答