我有一个运行许多测试的selenium测试套件,在每个新测试中,它打开了我打开的任何其他窗口顶部的浏览器窗口.在当地环境中工作时非常震动.有什么办法告诉selenium或操作系统(MAC)在后台打开窗口?
我似乎无法通过测试成功获得PhantomJS.我试图将它集成到我的项目中,但在那之后我尝试运行基本的Angular Docs示例,我遇到了同样的问题.我到目前为止的步骤:
npm install -g phantomjsphantomjs --webdriver=9515 // ... GhostDriver - Main - 在端口9515上运行protractor protractorConf.js这是仅包含browserName的示例中的同一文件,并且seleniumAddress端口已更改:
// An example configuration file.
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:9515',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'phantomjs'
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['onProtractorRunner.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
}
}; …Run Code Online (Sandbox Code Playgroud) 我正在使用量角器,当我将chrome指定为browsertype时它可以工作.我正在寻找一个无头浏览器示例代码,我已经找了phantomJs但我无法运行其中任何一个.是否有另一个无头浏览器的工作样本?