我正在node.js中为selenium编写一个脚本,它将转到一个页面并获取某个css类的innerhtml并将它们存储在一个数组中.
var element = driver.findElement(By.className("hll"));
element.getInnerHtml().then(html){
//returns 1 of the elements html where I want multiples
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试无头运行我的测试,并将我的两个测试套件分片以并行运行它们。在我的本地计算机上,它们并行运行,但在这种无头设置中,它们一个接一个地运行。我正在使用 Docker 映像作为 Web 驱动程序和量角器。
我正在使用 webnicer-protractor Docker 映像:https://hub.docker.com/r/webnicer/protractor-headless/ 并使用 elgalu/selenium 作为 Web 驱动程序。
我运行的conf.js文件如下所示:
exports.config = {
//Headless
//seleniumAddress: 'http://localhost:4444/wd/hub',
seleniumAddress: 'http://localhost:24444/wd/hub',
capabilities: {
browserName: 'chrome',
shardTestFiles: true,
maxInstances: 2
},
specs: ['Suites/AccountSettingsSuite.js', 'Suites/CloneDashboardSuite.js']
}
Run Code Online (Sandbox Code Playgroud)