Search code examples
getrequestrobotframeworkinsecure-connection

InsecureRequestWarning: Unverified HTTPS request is being made in Robot Framework.


Hi I'm Using Robot Framework.

I'm trying to send a Get Request but I get the following warning

C:\Python27\lib\site-packages\urllib3-1.21.1-py2.7.egg\urllib3\connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

Has anyone had this problem? As I've searched for a solution one of the advice was to disable the warning, but how to do it?

Thanks in Advance,


Solution

  • The following test case runs perfectly, without showing the warning. Please note the option verify=true on the Create Session keyword.

    *** Settings ***
    Library           Collections
    Library           String
    Library           RequestsLibrary
    Library           OperatingSystem
    
    *** Test Cases ***
    Get Requests
        [Tags]    get
        Create Session    google    http://www.google.com    verify=true
        Create Session    github    https://api.github.com    verify=true
        ${resp}=    Get Request    google    /    timeout=5
        Should Be Equal As Strings    ${resp.status_code}    200
        ${resp}=    Get Request    github    /users/bulkan    timeout=5
        Should Be Equal As Strings    ${resp.status_code}    200
        Dictionary Should Contain Value    ${resp.json()}    Bulkan Evcimen