我已经在windows 7和windows 10上使用chrome浏览器注册了两个平台到selenium grid服务器。
我想在Windows 10上的chrome浏览器上运行测试,但是当我运行测试时,测试在Windows 7上随机运行,在Chrome上随机运行。
当我们注册了多个平台时,您知道如何在特定的浏览器和平台上运行测试配置吗?
枢纽:
java -jar selenium-server-standalone-3.7.1.jar -role hubwindows 7上的注册节点:
java -Dwebdriver.chrome.driver=chromedriver_2.33.exe -jar selenium-server-standalone-3.7.1.jar -role node -hub http://localhost:4444windows 10上的注册节点:
java -Dwebdriver.chrome.driver=chromedriver_2.33.exe -jar selenium-server-standalone-3.7.1.jar -role node -hub http://localhost:4444protractor.conf.js
exports.config = {
specs: [
'**/*.mytest.e2e-spec.ts'
],
multiCapabilities: [
{
browserName: 'chrome',
platform: 'WIN10',
}
],
seleniumAddress: 'http://localhost:4444/wd/hub',
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
print: function () {
}
},
onPrepare: function () {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
}
};发布于 2017-12-05 03:04:54
发布于 2020-04-23 15:34:07
Selenium Grid安装过程:-
在计算机中使用以下命令启动集线器:-
在另一台计算机上使用以下命令启动节点:
(但是在这里,您的测试将失败,因为这里没有在集线器中提供铬驱动程序或壁虎驱动程序的文件路径。)
发布于 2017-12-04 12:14:02
您需要调整注册节点的命令,如下所示:
Windows 7上的寄存器节点:
java -Dwebdriver.chrome.driver=chromedriver_2.33.exe -jar selenium-server-独立-3.7.1.jar -role节点-hub http://localhost:4444/grid/registerWindows 10上的寄存器节点:
java -Dwebdriver.chrome.driver=chromedriver_2.33.exe -jar selenium-server-独立-3.7.1.jar -role节点-hub http://localhost:4444/grid/registerhttps://stackoverflow.com/questions/47631857
复制相似问题