问题
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.
I`m Running windows 8.1 Enterprise 64 bit on my host computer
The node and the host are on windows 7 Enterprise 32 bit service pack 1
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.
Extra information about my environment
Starting the hub:
java -jar selenium-server-standalone-3.3.1.jar -role hub -hubConfig hubConfig.json
My Hub config:
{
"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"
}
Starting the node:
java -jar selenium-server-standalone-3.3.1.jar -role node -nodeConfig nodeConfig.json
My node config file:
{
"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:
回答1:
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.
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);
On your node:
{
"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.
Note:
- operachromiumdriver is in my path variable
- my node and hub are running Windows 7
来源:https://stackoverflow.com/questions/43277677/opera-browser-in-selenium-grid-driver-class-not-found