Jenkins giving Type Error: String indices must be integer

Viewed 71

I am using robot framework for API testing, the tests are passing in local but failing in jenkins with the error TypeError: String indices must be integers.

Validate Response while ignoring keys
[Arguments]         ${service_details}
${resp}=            Set Variable        ${service_details}[response]
Should Be True      ${resp.status_code} == ${service_details}[expected_status]
${resp_content}=    Sanitize JSON       ${resp.text}
Log                 ${service_details}[expected_response]
Log                 ${resp_content}
Validate Response Contains Expected Response    ${resp_content}    ${service_details}[expected_response]   ${service_details}[ignored_keys]
...                                             ${service_details}[full_list_validation]  ${service_details}[identity_key]

It is failing with this error on the last Validate call, any idea what is going wrong in jenkins?

1 Answers

This error caused by Robotframework version or Python version in your Jenkins is not the same as your local environment. Fix it and it will work fine

Related