How to ignore certificate error when using Browser library?

1,260 views
Skip to first unread message

Ilkka Koskinen

unread,
Jun 21, 2023, 8:25:30 AM6/21/23
to robotframework-users
We are using Browser library and running our tests on Jenkins-server which tries to connect our actual web-page, but now all tests fail to an error
'Error: page.goto: net::ERR_CERT_AUTHORITY_INVALID at ...'

Error message is indeed correct, because we're using self-signed certificate, but how I could prevent my tests to fail?
Earlier when I used SeleniumLibrary I solved this by starting Chrome browser like this:
${chrome_options}=  Evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys, selenium.webdriver
Call Method     ${chrome_options}   add_argument --headless
Call Method ${chrome_options} add_argument --ignore-certificate-errors
Create Webdriver    Chrome  chrome_options=${chrome_options}

But how I could handle the situation in Chromium when using Browser library?
At the moment browser is started like this:
ELSE IF '${ActualBrowser}'=='CHROMIUM'
Close Browser
New Browser browser=chromium headless=false
    New Context    viewport={'width': 1920, 'height': 1080}
New Page url=${url-address}

Any hints how to go around the problem?
Rgs,
Ilkka

Ilkka Koskinen

unread,
Jun 21, 2023, 12:20:39 PM6/21/23
to robotframework-users
The solution for this problem was to add  ignoreHTTPSErrors=True -argument into New Context -command
New Context viewport={'width': 1920, 'height': 1080} ignoreHTTPSErrors=True
Reply all
Reply to author
Forward
0 new messages