i am trying to add negative test cases for login api request , where request status code 409 and that is as expected and design
at robot framework i have designed below code but during execution test case status fail and that is not correct .
what i am need is away to make these test cases pass as long as status code 409
*** Settings ***
Library RequestsLibrary
Test Template Login
*** Test Cases *** Username Password
Login with invalid username should fail invalid ${VALID_PASSWORD}
Login with invalid password should fail ${VALID_USER} invalid
Login with invalid username and password should fail invalid invalid
Login with empty username should fail ${EMPTY} ${VALID_PASSWORD}
Login with empty password should fail ${VALID_USER} ${EMPTY}
Login with empty username and password should fail ${EMPTY} ${EMPTY}
*** Keywords ***
Login
[Arguments] ${USERNAME} ${PASSWORD}
${data}= Evaluate {‘Username’: (None, ‘${USERNAME}’), ‘Password’: (None, ‘${PASSWORD}’)}
${response}= POST ${Server_url}${Login} files=${data}
Log To Console ${response.content}
assertions
Should Be Equal As Strings ${response.status_code} 409
${json_dict}= Evaluate json.loads(‘’‘${response.content}’‘’) modules=json
Should not Be Equal As Strings None ${json_dict[‘errorCode’]}
Should not Be Equal As Strings None ${json_dict[‘errorMessage’]}
Should not Be Equal As Strings Authentication failed ${json_dict[‘errorMessage’]}
Should Be Equal As Strings failed ${json_dict[‘status’]}
Should Be Equal As Strings None ${json_dict[‘data’]}