ab.sharma
ab.sharma

Reputation: 190

Ignore or resolve certificate warnings for test automation in robot framework

While browsing URL using the robot automation framework, I am always getting a message "Your connection is not private". Then we need to click on Advanced and Proceed to URL. Manually proceeding to URL is not possible. So is there any solution to skip such certificate checking for test automation in the robot framework. I had read the answer for the question: How to resolve ssl certificate errors for test automation in robot framework . I tried following but it didn't work.

Open Browser    ${loginUrl}    browser=${browser}    options=add_argument("--ignore-certificate-errors")

The error says:

- Positional argument cannot be used after named arguments. Although this argument looks like named one, it isn't because there is no 'options' argument in the keyword definition

Please help.

Upvotes: 2

Views: 6552

Answers (2)

Ragavendran
Ragavendran

Reputation: 11

We cannot combine positional and named arguments. Try this:

Open Browser    url=${loginUrl}    browser=${browser}    options=add_argument("--ignore-certificate-errors")

Upvotes: 1

Sariq Shaikh
Sariq Shaikh

Reputation: 1124

You can try with creating web driver and set parameters separately as shown below.

*** Test Cases ***
TestProcess
    ${chrome_options}    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
    Call Method    ${chrome_options}    add_argument    --ignore-certificate-errors    
    Create Webdriver    Chrome    chrome    chrome_options=${chrome_options}    
    Go To    https://expired.badssl.com/

Upvotes: 3

Related Questions