Selenium 网格中的 Opera 浏览器:未找到驱动程序 class
Opera browser in Selenium grid: Driver class not found
我正在尝试使用 Selenium 网格设置环境以在远程计算机上执行我的 Selenium 测试。我唯一无法使用的浏览器是 Opera。我将其配置为与其他浏览器相同。但是,当我启动节点时,它显示未找到驱动程序 class。
我是 运行 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
如果有人知道这个问题,请帮助我。
关于我的环境的额外信息
正在启动集线器:
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": {}
}
驱动位置截图:
回答我自己的问题是因为我找到了答案,我希望能帮助所有用谷歌搜索这个问题的人:)
原来 Opera 驱动程序是旧版驱动程序,您不需要它。
您确实需要 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": {}
}
我希望这对某人有用,至少对我有用。
注:
- operachromiumdriver 在我的路径变量中
- 我的节点和集线器是运行Windows7
我正在尝试使用 Selenium 网格设置环境以在远程计算机上执行我的 Selenium 测试。我唯一无法使用的浏览器是 Opera。我将其配置为与其他浏览器相同。但是,当我启动节点时,它显示未找到驱动程序 class。
我是 运行 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
如果有人知道这个问题,请帮助我。
关于我的环境的额外信息
正在启动集线器:
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": {}
}
驱动位置截图:
回答我自己的问题是因为我找到了答案,我希望能帮助所有用谷歌搜索这个问题的人:)
原来 Opera 驱动程序是旧版驱动程序,您不需要它。
您确实需要 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": {}
}
我希望这对某人有用,至少对我有用。
注:
- operachromiumdriver 在我的路径变量中
- 我的节点和集线器是运行Windows7