Selenium网格中的Opera浏览器:未找到驱动程序类
我正在尝试使用Selenium网格设置环境以在远程计算机上执行Selenium测试.我无法使用的唯一浏览器是Opera.我将其配置与其他浏览器相同.但是,当我启动节点时,它显示未找到Driver类.
I'm trying to setup an environment with Selenium grid to execute my Selenium test on a remote machine. The only browser I can`t get to work is Opera. I configured it the same as the other browsers. However when I start the node it shows a Driver class not found.
我在主机上运行Windows 8.1 Enterprise 64位
I`m Running windows 8.1 Enterprise 64 bit on my host computer
节点和主机位于Windows 7 Enterprise 32位Service Pack 1上
The node and the host are on windows 7 Enterprise 32 bit service pack 1
在安装主机Opera时,该Opera Web驱动程序位于C:/GUI-Tests/Drivers/operadriver.exe中,我尝试了32位Webdriver和64位Webdriver,但仍然出现错误:>
On the host opera is installed, the opera webdriver is in C:/GUI-Tests/Drivers/operadriver.exe, I tried the 32 bit webdriver and the 64 bit webdriver and I`m still getting the error:
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
如果有人对这个问题有所了解,请帮助我.
If anyone knows something about this problem please help me.
启动中心:
java -jar selenium-server-standalone-3.3.1.jar -role hub -hubConfig hubConfig.json
我的集线器配置:
{
"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"
}
启动节点:
java -jar selenium-server-standalone-3.3.1.jar -role node -nodeConfig nodeConfig.json
我的节点配置文件:
{
"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": {}
}
驱动程序位置的屏幕截图:
A screenshot of the drivers location:
回答我自己的问题,因为我找到了答案,我希望能帮助所有对此问题进行谷歌搜索的人:)
Answering my own question because I discovered the answer, and I`m hoping to help everyone that googles on this question :)
事实证明,歌剧驱动程序是旧驱动程序,您将不需要它.
Well it turns out opera driver is a legacy driver, you won't need it.
您确实需要Opera浏览器和 operachromiumdriver .在c#中,将您的功能定义为:
You do need the Opera browser and operachromiumdriver. In c# define your capabilities as:
capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.BrowserName, "operablink");
capabilities.Platform = new Platform(PlatformType.Windows);
_webDriver = new RemoteWebDriver(_gridServerUri, capabilities);
在您的节点上:
{
"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": {}
}
我希望这至少对某人有用.
I hope this will be useful to someone at least it was useful to me.
- operachromiumdriver位于我的路径变量中
- 我的节点和集线器正在运行Windows 7