我正在尝试使用selenium-server-standalone-3.0.1在WIN10上启动Microsoft Edge。 在创建驱动程序实例时,浏览器在节点上打开很好,但随后进程挂起大约一分钟左右,生成以下错误,导致驱动程序对象返回NULL。以下是错误消息:
org.openqa.selenium.WebDriverException:转发新会话时出错转发请求时出错读取超时 命令持续时间或超时:134.17秒 构建信息:版本:' 3.4.0',修订版:'未知' ...
请记住 - 这适用于Chrome。
另请注意:
这是我的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
}
这是我的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
}
我启动HUB的命令
java -jar selenium-server-standalone-3.0.1.jar -role hub -hubConfig hubConfig.json
启动节点:
java "-Dwebdriver.edge.driver=C:\Selenium\EdgeDriver\MicrosoftWebDriver.exe" -jar selenium-server-standalone-3.0.1.jar -role node -nodeConfig nodeConfig.json
当我这样做时,我可以看到节点在集线器上注册正常(它必须是或者我无法启动浏览器!)
这是我创建驱动程序对象的java代码
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);
以下是节点的日志输出
INFO - 节点已注册到集线器并准备使用
INFO - SessionCleaner使用insideBrowserTimeout 60000和 clientGoneTimeout 1800000轮询每个DEBUG - 处理:POST /会话
INFO - 执行:[新会话:功能 [{browserName = MicrosoftEdge,version = 13,platform = WIN10}]])
信息 - 为功能创建新会话 [{browserName = MicrosoftEdge,version = 13,platform = WIN10}]
DEBUG - 执行:newSession [null,newSession {desiredCapabilities = Capabilities [{browserName = MicrosoftEdge,
version = 13,platform = 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} {主机: ocalhost:31485} {接受:text / html,image / gif,image / jpeg,*; Q = 0.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} {Server: Microsoft-HTTPAPI / 2.0} {Access-Control-Allow-Origin:*} {Date:Fri,01 2017年9月22:55:00 GMT} {Content-Length:121}
INFO - 假设Postel的法律成立,试图进行双方言会议 在远程端
DEBUG - 选择CookieSpec:默认
DEBUG - 未在上下文中设置Auth缓存
DEBUG - 连接请求:[route:{} - > http:/ localhost:31485] [总计 活着:0;分配的路线:2000年的0;总分配:2000年第0期] 15:55:00.151 DEBUG - 连接出租:[id:1] [路线: {} - > http://localhost:31485][total保持活跃:0;分配的路线:1 2000;总分配:2000年第1期]
DEBUG - 打开连接{} - > http:/ localhost:31485
DEBUG - 连接到localhost / 127.0.0.1:31485
DEBUG - 建立连接127.0.0.1:50687< - &gt; 127.0.0.1:31485
DEBUG - http-outgoing-1:将套接字超时设置为10800000
DEBUG - 执行请求POST /会话HTTP / 1.1 DEBUG - 目标身份验证 state:UNCHALLENGED DEBUG - 代理身份验证状态:UNCHALLENGED
DEBUG - http-outgoing-1&gt;&gt; POST / session HTTP / 1.1 DEBUG - http-outgoing-1&gt;&gt; Content-Type:application / json;字符集= UTF-8
DEBUG - http-outgoing-1&gt;&gt;内容长度:247DEBUG - http-outgoing-1&gt;&gt;主持人:localhost:31485
DEBUG - http-outgoing-1&gt;&gt;连接:Keep-Alive
DEBUG - http-outgoing-1&gt;&gt; User-Agent:Apache-HttpClient / 4.5.2 (爪哇/ 1.8.0_102)
DEBUG - http-outgoing-1&gt;&gt; Accept-Encoding:gzip,deflate DEBUG - http-outgoing-1&gt;&gt; &#34; POST / session HTTP / 1.1 [\ r] [\ n]&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34;内容类型:application / json; 字符集= UTF-8 [\ R] [\ n]的&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34;内容长度:247 [\ r] [\ n]&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34;主持人:localhost:31485 [\ r] [\ n]&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34;连接:Keep-Alive [\ r] [\ n]&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34; User-Agent:Apache-HttpClient / 4.5.2 (爪哇/ 1.8.0_102)[\ R] [\ n]的&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34;接受编码:gzip,deflate [\ r] [\ n]&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34; [\ R] [\ n]的&#34;
DEBUG - http-outgoing-1&gt;&gt; &#34; {&#34;功能&#34; {&#34; desiredCapabilities&#34; {&#34; browserName&#34;:&#34; MicrosoftEdge&#34;&#34;版本&#34 ;:13,&#34;平台&#34;:&#34; WIN10&#34;}&#34; requiredCapabilities&#34 ;: {}},&#34; desiredCapabilities&#34 ;: {&#34; browserName&#34;:&#34; MicrosoftEdge&#34;&#34;版本&#34;:13,&#34;平台&#34;:&#34; WIN10&#34;},& #34; requiredCapabilities&#34 ;: {}}&#34;