我们有一个硒网格,其中除一个节点外,所有节点都完全相同。所有相同的节点都运行Windows 10,具有基本的chrome,IE,边缘浏览器,并在MST上运行。该例外运行IE,chrome和edge,但它们的设置看起来像在英国一样,并在一年中的大部分时间运行GMT + 0(当然,DST除外,然后运行BST)。这会更改日期格式等,并用于测试日期格式是否正确以及我们系统上的文档是否反映了各自时区中的准确时间。英国节点上的浏览器均具有在其Selenium网格的node_XXXX.json文件中声明的自定义浏览器版本。
我们不久前丢失了中心服务器,并且在重建之后,我们无法再使IE,EDGE和Firefox浏览器在英国服务器上运行。我们曾经为Uk浏览器使用自定义浏览器版本,例如:而不是“ version”:11而是“ version”:“ 11.eu”表示我们要在特殊服务器上运行。 Chrome可以在这种模式下正常工作。但是,IE显示错误:
OpenQA.Selenium.WebDriverException : Error forwarding the new session cannot find : Capabilities {browserName: internet explorer, browserVersion: 11.eu, platformName: windows, se:ieOptions: {enablePersistentHover: true, ie.ensureCleanSession: true, nativeEvents: true}}
我们已经尝试过更改版本号(以前说的是9.eu,这是我们运行IE9时的旧版本)。我们还尝试了将IE重新“更新”到版本11。没有任何效果或驱动程序无法连接。
我们如何使我们的UK IE浏览器再次在硒网格上运行?我们有很多测试失败,仅仅是因为它们无法连接到驱动程序实例。任何帮助将不胜感激,谢谢!
供参考,这是我们的node_XXXX.json文件:
{
"capabilities": [
{
"seleniumProtocol": "WebDriver",
"browserName": "firefox",
"maxInstances": 1,
"version": "17.eu",
"platform": "WINDOWS"
},
{
"seleniumProtocol": "WebDriver",
"browserName": "internet explorer",
"maxInstances": 1,
"version": "11.eu",
"platform": "windows"
},
{
"seleniumProtocol": "WebDriver",
"browserName": "chrome",
"maxInstances": 1,
"version": "77.eu",
"platform": "WINDOWS"
}
],
"loadedFromFile":
"node_5555.json",
"proxy": "com.groupon.seleniumgridextras.grid.proxies.SetupTeardownProxy",
"servlets": [],
"maxSession": 3,
"port": 5555,
"register": true,
"unregisterIfStillDownAfter": 10000,
"hubPort": 4444,
"hubHost": "test-slum01.ndtest.local",
"registerCycle": 5000,
"nodeStatusCheckTimeout": 10000,
"custom": {},
"downPollingLimit": 0
}
这是调用远程Web驱动程序的代码:
case "iehta9UK":
var ieUkOptions = new InternetExplorerOptions();
ieUkOptions.EnsureCleanSession = true;
ieUkOptions.BrowserVersion = "11.eu";
return IS_REMOTE_RUN ? CreateRemoteWebDriver(ieUkOptions) : new InternetExplorerDriver(ieUkOptions);
这是严格的美国IE代码,可以正常工作:
case "IE":
case "ie":
case "InternetExplorer":
case "iehta11":
var ieOptions = new InternetExplorerOptions();
ieOptions.EnsureCleanSession = true;
return IS_REMOTE_RUN ? CreateRemoteWebDriver(ieOptions) : new InternetExplorerDriver(ieOptions);
啊哈!我们知道了。我们已经对上面显示的node_XXXX.json文件进行了更改,但是还没有重新启动硒网格服务。
请确保在对json文件进行更改后重新启动服务器,以使它们生效。