问题
I'm getting ssl certificate error for our web application while running automation tests via robot framework. I tried below code with different chrome options but none of them worked that too with & without boolean value.
${list} = Create List --unsafely-treat-insecure-origin-as-secure=True
${args} = Create Dictionary args=${list}
${desired caps} = Create Dictionary chromeOptions=${args}
open browser about:blank ${BROWSER} desired_capabilities=${desired_caps}
Thank you in advance
回答1:
Both Firefox and Chrome (possibly others, did not test) support --ignore-certificate-errors option and Open Browser keyword has support for passing options to browsers, see https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Foo
Open Browser https://expired.badssl.com/ firefox options=add_argument("--ignore-certificate-errors")
Capture Page Screenshot
[Teardown] Close All Browsers
来源:https://stackoverflow.com/questions/59785694/how-to-resolve-ssl-certificate-errors-for-test-automation-in-robot-framework