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

问题描述

在使用机器人自动化框架浏览 URL 时,我总是收到一条消息您的连接不是私密的".然后我们需要点击高级并继续到 URL.手动处理 URL 是不可能的.那么是否有任何解决方案可以跳过机器人框架中测试自动化的此类证书检查.我已经阅读了这个问题的答案:如何解决机器人框架中测试自动化的ssl证书错误.我尝试关注,但没有成功.

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")

错误说:

- 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

请帮忙.

推荐答案

您可以尝试单独创建 Web 驱动程序并设置参数,如下所示.

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/

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

09-22 10:05