How to resolve ssl certificate errors for test automation in robot framework

让人想犯罪 __ 提交于 2020-06-16 20:25:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!