5

I am trying to run automated API tests on localhost with an invalid cert.

Is there a chromeOption equivalent to "Proceed Anyway" that I can pass to the tests so they can get a response from the url?

Right now I am manually testing the API via Postman (after using Proceed Anyway in Chrome), so the API itself does work, but the automation cannot get a response.

Vishal Aggarwal
5,5832 gold badges20 silver badges37 bronze badges
asked Jul 28, 2016 at 16:31

2 Answers 2

2

This is works for me (in python):

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
webdriver_instance = webdriver.Chrome(chrome_options=options)

See also: https://stackoverflow.com/questions/24507078/how-to-deal-with-certificates-using-selenium and https://stackoverflow.com/questions/24168407/unsupported-command-line-flag-ignore-certificate-errors

answered Jul 28, 2016 at 16:49
1

As this is tagged with protractor, this is how you allow "unsecure HTTPS" via Protractor config:

In case of Firefox:

capabilities: { 
 browserName: 'firefox', 
 marionette: true, 
 acceptInsecureCerts: true
}

In case of Chrome (not tested and may not work as is, https://github.com/angular/protractor/issues/847):

capabilities: { 
 browserName: 'chrome', 
 chromeOptions: {
 args: ['--ignore-certificate-errors']
 }
}
alecxe
11.4k11 gold badges52 silver badges107 bronze badges
answered Oct 30, 2018 at 7:48
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.