我对使用Protractor和Selenium非常陌生,所以请耐心等待我,我设置了量角器conf.js和spec.js文件,这些文件使用多个 - 使用Chrome / IE11 / EDGE异步工作conf.js中的功能选项但是当Firefox尝试加载它时会发出“#34;该地址无效"浏览器上的页面,所以我认为它不是Firefox webdriver。我在控制台中收到的错误是;
[12:41:30] I/testLogger - [firefox #21] PID: 12532
[firefox #21] Specs: d:\My Documents\Visual Studio2015\Projects\TaskManager\FrontNodeTests\Tests\spec.js
[firefox #21]
[firefox #21] [12:40:43] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[firefox #21]
[firefox #21] C:\Users\%USERNAME%\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27
[firefox #21] super(opt_error);
[firefox #21] ^
[firefox #21] WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.
[12:41:30] I/launcher - firefox #21 failed with exit code: 1
[12:41:30] E/launcher - Process exited with error code 100
我的conf.js文件是;
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
specs: ['spec.js'],
multiCapabilities: [
{
'browserName': 'chrome'
}, {
'browserName': 'internet explorer',
'platform': 'ANY',
'version': '11'
},
{
'browserName': 'firefox'
},
{
'browserName' : 'MicrosoftEdge'
}
],
onPrepare: function () {
var specReporter = require("jasmine-spec-reporter");
jasmine.getEnv()
.addReporter(
new specReporter(
{
displayStackTrace: 'all',
displaySuccessesSummary: true,
displayPendingSpec: true,
displaySuiteNumber: true
}));
},
baseUrl: 'http://localhost:'
};
我还使用.bat文件来运行Selenium服务器,以及量角器测试套件,如果有任何帮助的话。
感谢任何帮助/建议,谢谢:)