如何解决机器人框架中测试自动化的 ssl 证书错误 [英] How to resolve ssl certificate errors for test automation in robot framework

查看:172
本文介绍了如何解决机器人框架中测试自动化的 ssl 证书错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过机器人框架运行自动化测试时,我的 Web 应用程序出现 ssl 证书错误.我尝试了以下具有不同 chrome 选项的代码,但没有一个也适用于 &没有布尔值.

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}

提前致谢

推荐答案

Firefox 和 Chrome(可能是其他的,没有测试)支持 --ignore-certificate-errors 选项,Open Browser 关键字支持将选项传递给浏览器,请参阅 https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser

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

这篇关于如何解决机器人框架中测试自动化的 ssl 证书错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆