Tho*_*mas 1 selenium selenium-grid selenium-webdriver
我正在尝试使用 Selenium 网格设置环境以在远程机器上执行我的 Selenium 测试。我唯一无法工作的浏览器是 Opera。我的配置和其他浏览器一样。但是,当我启动节点时,它显示找不到驱动程序类。
我在我的主机上运行 Windows 8.1 Enterprise 64 位
节点和主机在 windows 7 Enterprise 32 位服务包 1 上
在主机上安装了opera,opera webdriver 位于C:/GUI-Tests/Drivers/operadriver.exe,我尝试了32 位webdriver 和64 位webdriver,但仍然出现错误:
13:30:37.169 INFO - Driver class not found: com.opera.core.systems.OperaDriver
13:30:37.169 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped: Unable to create new instances on this machine.
13:30:37.178 INFO - Driver class not found: com.opera.core.systems.OperaDriver
13:30:37.178 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
Run Code Online (Sandbox Code Playgroud)
如果有人知道这个问题,请帮助我。
启动集线器:
java -jar selenium-server-standalone-3.3.1.jar -role hub -hubConfig hubConfig.json
Run Code Online (Sandbox Code Playgroud)
我的集线器配置:
{
"host": ip,
"maxSessions": 5,
"port": 4444,
"cleanupCycle": 5000,
"timeout": 300000,
"newSessionWaitTimeout": -1,
"servlets": [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 180000,
"platform": "WINDOWS"
}
Run Code Online (Sandbox Code Playgroud)
启动节点:
java -jar selenium-server-standalone-3.3.1.jar -role node -nodeConfig nodeConfig.json
Run Code Online (Sandbox Code Playgroud)
我的节点配置文件:
{
"capabilities":
[
{
"browserName": "opera",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.opera.driver": "C:/GUI-Tests/Drivers/operadriver.exe"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "http://localhost:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 2,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
Run Code Online (Sandbox Code Playgroud)
回答我自己的问题,因为我发现了答案,我希望能帮助所有在这个问题上搜索的人:)
事实证明,opera 驱动程序是遗留驱动程序,您不需要它。
您确实需要 Opera 浏览器和operachromiumdriver。在 c# 中,将您的能力定义为:
capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.BrowserName, "operablink");
capabilities.Platform = new Platform(PlatformType.Windows);
_webDriver = new RemoteWebDriver(_gridServerUri, capabilities);
Run Code Online (Sandbox Code Playgroud)
在您的节点上:
{
"capabilities":
[
{
"browserName": "operablink",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "http://localhost:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 2,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
Run Code Online (Sandbox Code Playgroud)
我希望这对某人有用,至少对我有用。
| 归档时间: |
|
| 查看次数: |
1779 次 |
| 最近记录: |