Hi All,
I am trying to use this WS.verifyResponseStatusCode(httpResponse, expectedCode) to verify the HTTP return code, and continue my test steps differently between 200 and 302 return codes. This method is expected to just return true or false, but I found that when the status code was not matching the expectedCode (i.e. the false scenario), this method just failed this test case without allowing to continue the test steps. Bellow is the console log.
2022-09-23 13:28:39.420 ERROR c.k.k.core.keyword.internal.KeywordMain -
Expected status code is ‘302’ but actual status code is ‘200’
2022-09-23 13:28:39.429 ERROR c.k.k.core.keyword.internal.KeywordMain -
Unable to verify response status code (Root cause: com.kms.katalon.core.exception.StepFailedException: Expected status code is ‘302’ but actual status code is ‘200’
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:50)
I also tried with WS.verifyResponseStatusCode(historyResponse, expectedCode, FailureHandling.CONTINUE_ON_FAILURE), but it still failed this test case.
Thank you for your input.
Ken