Protractor error message “unsupported command-line

2019-01-31 11:34发布

I'm a new user to Protractor, and I encountered this error running my tests using Chrome (error displays beneath the address bar in the launched browser):

You are using an unsupported command-line flag --ignore-certificate-errors. Stability and security will suffer.

Here is my conf.js for Protractor:

exports.config = {

seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
    'browserName': 'chrome'  
},

...

Also, I am using a Mac with the latest available Chromedriver and Selenium standalone server (2.41.0). Now, I haven't set this flag anywhere, and I don't recall it always displaying so I'm not sure what caused this problem.

Any ideas on how to resolve this issue?

9条回答
欢心
2楼-- · 2019-01-31 12:32

Selenium using C#.Net (Selenium + C#.Net)

public static IWebDriver Instance = null;
ChromeOptions opt = new ChromeOptions();

opt.AddArguments("--test-type");<br><br>
Instance = new ChromeDriver(@"Path To directory containing chromedriver.exe" , opt ) ;

It works for Google Chrome Version 47.0.2526.106 m.

查看更多
迷人小祖宗
3楼-- · 2019-01-31 12:35
#!/usr/bin/env node
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().withCapabilities({
    browserName : 'chrome',
    'chromeOptions': {
        args: ['test-type']
    }
}).build();
查看更多
淡お忘
4楼-- · 2019-01-31 12:37

This error also happened for me when I tried to run "npm run protractor" on step 3 of the Angular tutorial at https://docs.angularjs.org/tutorial/step_03

I'm running Chrome Version 35.0.1916.153 on a MacBook Pro.

@scheffield - thanks, your solution worked for me.

(Also it may not be obvious on that tutorial step 3, but as in previous steps, you still have to start your web server by opening a new terminal window in the directory where you downloaded the tutorial and issuing "npm start". Then in a separate terminal window you execute "npm run protractor"). With the protractor config tweak the error went away.

查看更多
登录 后发表回答