When testing my API i found that even though I set up a condition on StatusCode = 200, the test will pass regardless of response if I run the whole test. If I run the step seperately, the test will fail.
You're welcome! Thank you for using Test Studio for APIs and please let us know if you ever have further feedback or questions. We are always happy to help.
Posted on:13 Apr 2018 08:24
Ah, thanks! Sorry about the misunderstanding and thank you for your time.
Posted on:13 Apr 2018 08:09
It seems like you need to use a Verification (https://docs.telerik.com/teststudio-apis/features/verifications) here, not a Condition (https://docs.telerik.com/teststudio-apis/features/condition). A condition is only meant to prevent your test from executing in the first place if the "StatusCode" variable, that is created by the last executed previous step is not equal to '200', while a verification will first let your step execute and then check its own 'StatusCode'.
If my suggestion about your use case is right, please remove the condition and try adding it in the same way in the 'Verifications' tab, just next to the 'Condition' tab.
Let me know if I could help with anything else.