我第一次尝试使用边缘驱动程序,但在使用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
并且具有该文件夹的环境变量
我正在使用.....
所有其他WebDrivers目前都在selenium网格中工作。
如果有人能够帮助我会永远感激
答案 0 :(得分:0)
如this answer中所述,在与其他浏览器相同的节点中使用Edge会导致此类问题。解决方法是在同一台机器上启动2个独立的节点:一个仅用于Edge,另一个用于IE,FF和Chrome。