我正在尝试使用selenium-server-standalone-3.0.1在WIN10上启动Microsoft Edge . 在创建驱动程序实例时,浏览器在节点上打开正常,但随后进程挂起大约一分钟左右,生成以下错误,导致驱动程序对象返回NULL . 这是错误消息:

org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out Command duration or timeout: 134.17 seconds Build info: version: '3.4.0', revision: 'unknown' ...

请记住 - 这适用于Chrome .

另请注意:

  • 我可以从Node上的Edge浏览器ping我的HUB机器URL

  • 我试过以下版本,结果相同:3.0.1,3.3.1,3.5.0,3.5.3

Here is my hubConfig:

{
  "host": {hidden for security},
  "port": 4444,
  "newSessionWaitTimeout": -1,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {},
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "cleanUpCycle": 5000,
  "role": "hub",
  "debug": true,
  "browserTimeout": 60,
  "timeout": 1800
}

And here is my nodeConfig

{
  "capabilities":
  [
    {
      "browserName": "MicrosoftEdge",
      "maxInstances": 5,
      "platform": "WIN10"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 5,
  "port": 5555,
  "register": true,
  "registerCycle": 500000,
  "hub": "http://{hidden for security}:4444/grid/register",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 500000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": true,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {},
  "browserTimeout": 60,
  "timeout": 1800
}

My Command to start the HUB

java -jar selenium-server-standalone-3.0.1.jar -role hub -hubConfig hubConfig.json

And to start the node:

java "-Dwebdriver.edge.driver=C:\Selenium\EdgeDriver\MicrosoftWebDriver.exe" -jar selenium-server-standalone-3.0.1.jar -role node -nodeConfig nodeConfig.json

当我这样做时,我可以看到节点在集线器上注册正常(它必须是或者我将无法启动浏览器!)

Here is my java code to create the driver object

DesiredCapabilities capability = DesiredCapabilities.edge(); capability.setBrowserName("MicrosoftEdge");
    capability.setCapability(CapabilityType.PLATFORM, Platform.WIN10);
    driver = new RemoteWebDriver(new URL("http://{hidden for security}:4444/wd/hub"),capability);

Here is the log output for the node

INFO - 节点已注册到集线器并准备使用INFO - 使用insideBrowserTimeout 60000初始化的SessionCleaner和每个DEBUG的clientGoneTimeout 1800000轮询 - 处理:POST /会话INFO - 执行:[new session:Capabilities [{browserName = MicrosoftEdge,version = 13,platform = WIN10}]])INFO - 为Capabilities创建一个新会话[{browserName = MicrosoftEdge,version = 13,platform = WIN10}] DEBUG - 执行:newSession [null,newSession {desiredCapabilities = Capabilities [{browserName = MicrosoftEdge ,版本= 13,平台= WIN10}]}] DEBUG - 等待[http:/ localhost:31485 / status] DEBUG - 轮询http:/ localhost:31485 / status DEBUG - 轮询http:/ localhost:31485 / status DEBUG - 轮询http:/ localhost:31485 / status DEBUG - sun.net.www.MessageHeader@4fee0bb35对:{GET / status HTTP / 1.1:null} {User-Agent:Java / 1.8.0_102} {Host:ocalhost:31485} {接受:text / html,image / gif,image / jpeg,; q = .2,/; q = .2} {Connection:keep-alive} DEBUG - sun.net.www.MessageHeader@4129fc3e6对:{null:HTTP / 1.1 200 OK} {Content-Type:application / json; charset = UTF-8} {服务器:Microsoft-HTTPAPI / 2.0} {Access-Control-Allow-Origin:} {Date:Fri,01 Sep 2017 22:55:00 GMT} {Content-Length:121} INFO - 尝试双方会话,假设Postel的定律适用于远程端DEBUG - 选择CookieSpec:默认DEBUG - 未在上下文中设置Auth缓存DEBUG - 连接请求:[route:{} - > http:/ localhost:31485] [保持活动总数:0;分配的路线:2000年的0;总分配:0 of 2000] 15:55:00.151 DEBUG - 连接租用:[id:1] [route:{} - > http:// localhost:31485] [保持活动总数:0;分配的路线:2000年1月;总分配:2000年1月] DEBUG - 打开连接{} - > http:/ localhost:31485 DEBUG - 连接到localhost / 127.0.0.1:31485 DEBUG - Build 连接127.0.0.1:50687<->127.0.0.1:31485 DEBUG - http-outgoing-1:设置套接字超时为10800000 DEBUG - 执行请求POST /会话HTTP / 1.1 DEBUG - 目标身份验证状态:UNCHALLENGED DEBUG - 代理身份验证状态:UNCHALLENGED DEBUG - http-outgoing-1 >> POST / session HTTP / 1.1 DEBUG - http-outgoing-1 >> Content-Type:application / json; charset = utf-8 DEBUG - http-outgoing-1 >>内容长度:247 DEBUG - http-outgoing-1 >>主机:localhost:31485 DEBUG - http-outgoing-1 >>连接:Keep-Alive DEBUG - http -outgoing-1 >> User-Agent:Apache-HttpClient / 4.5.2(Java / 1.8.0_102)DEBUG - http-outgoing-1 >> Accept-Encoding:gzip,deflate DEBUG - http-outgoing-1 >>“ POST / session HTTP / 1.1 [\ r] [\ n]“DEBUG - http-outgoing-1 >>”Content-Type:application / json; charset = utf-8 [\ r] [\ n]“DEBUG-http -outgoing-1 >>“Content-Length:247 [\ r] [\ n]”DEBUG - http-outgoing-1 >>“主持人:localhost:31485 [\ r] [\ n]”DEBUG - http-outgoing -1 >>“连接:保持活动[\ r] [\ n]”DEBUG - http-outgoing-1 >>“用户代理:Apache-HttpClient / 4.5.2(Java / 1.8.0_102)[\ r \ n ] [\ n]“DEBUG - http-outgoing-1 >>”接受编码:gzip,deflate [\ r] [\ n]“DEBUG - http-outgoing-1 >>”[\ r] [\ n] “DEBUG - http-outgoing-1 >>”{“capabilities”:{“desiredCapabilities”:{“browserName”:“MicrosoftEdge”,“version”:13,“platform”:“WIN10”},“requiredCapabilities”:{ },“desiredCapabilities”:{“眉毛serName“:”MicrosoftEdge“,”version“:13,”platform“:”WIN10“},”requiredCapabilities“:{}}”