我尝试使用Selenium网格设置环境以在远程计算机上执行我的Selenium测试。我唯一无法工作的浏览器是Opera。我将其配置为与其他浏览器相同。但是,当我启动节点时,它显示找不到Driver类。
我在我的主机上运行Windows 8.1 Enterprise 64位
节点和主机位于Windows 7 Enterprise 32位Service Pack 1
上在安装主播歌剧时,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
如果有人知道这个问题,请帮助我。
启动集线器:
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": {}
}
答案 0 :(得分:3)
回答我自己的问题,因为我发现了答案,而且我希望能帮助那些在这个问题上搜索的人:)
事实证明,歌剧司机是一个传统的驱动程序,你不会需要它。
您确实需要Opera浏览器和operachromiumdriver。在c#中将您的能力定义为:
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": {}
}
我希望这对某些人有用,至少对我有用。