我在repo
下的error.js-中收到错误应用程序数据\漫游\ NPM \ node_modules \量角器\ node_modules \硒的webdriver \ error.js
我得到的错误是:
超级(选择错误){
" WebDriverError:驱动程序可执行文件的路径必须由webdriver.chrome.driver系统属性设置;"
我只创建了两个文件,一个是conf.js,另一个是test_spec.js。
test_spec.js
describe('angularjs homepage', function() {
it('should have a title', function() {
browser.get('http://angular.org/');
expect(browser.getTitle()).toContain('AngularJS');
});
});
conf.js
exports.config = {
//The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
//Here we specify the name of the specs files.
specs: ['test_spec.js']
}
我想在这里提一下,根据我的config.json,我的selenium文件夹下的所有文件都是chromedriver.exe,chromedriver_2.21.zip和selenium-server-standalone-2.53.0但是我还是得到了这个错误。
答案 0 :(得分:0)
您能否按照以下步骤检查它是否能解决您的问题。
打开终端并输入以下命令。
1.npm install -g protractor
2.webdriver-manager update
3.webdriver-manager start
4.protractor path-to-config.json file
答案 1 :(得分:0)
尝试使用此protractor.conf.js
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec/**/*[sS]pec.js'],
/*
* If u want to use only one browser
capabilities: {
"browserName": "chrome"
},
* By this you can use multiBrowser
*
*/
multiCapabilities:[
{
'browserName' : 'chrome'
},
/*{
'browserName' : 'firefox'
},
{
'browserName' : 'internet explorer',
'platform' : 'ANY',
'version' : '11'
},
{
'browserName' : 'phantomjs'
},
*/
],
/*
* Force protractor to use only one browser at a time
*/
maxSessions: 1,
allScriptsTimeout: 60000,
jasmineNodeOpts: {
defaultTimeoutInterval: 360000,
showTiming: true,
isVerbose:true,
},
onPrepare: function () {
/*
Set browser window size
*/
browser.driver.manage().window().setSize(1920, 1080);
},
/*
Set your app's main URL here, so you can use relative urls along the tests
*/
baseUrl: 'http://url_to_app.com',
};