One difference I’ve noticed between the article’s example and my API tests is that running a test request from my Object repository file will fail since my parameter’s value isn’t specified, but in the documentation’s example, their test still works.
Is there a workaround to make the documentation’s solution work or a way that I can add multiple JSON files to my test and specify which one to use during each test?
Running from the object repository like this should fail (though it doesn’t in the guide):
But when I create a test case and add in my parameter in script mode, my test again fails with an error code of 400.
Looks to me that you are trying to run your parameterized request directly from the Object Repository itself, which does not work, coz the parameters are not handled there (yet).
Maybe add a feature request for being able to test Parametrized Web Services objects directly from the Repository too.
The working example you mentioned however is being runned from a script.
Thomas,
Your request could not be executed at Object Repository since it only contains parameters, not the actual value. In order to test the web service, you could create a test case, add Send Request test step for this web service and execute the test there.
Sorry I did not make this clear in my original post, but I understand that I should get a 400 error when I run directly from the object repository. My issue is that when I then created a Test Case where I specified the value of my parameter the Test Case also failed with a 400 error.
But then I found in my case it happened when the variable type was String and I passed it null.
If I pass an empty string ‘’ or any string, it will work.
So, if you are in the same boat, just pass empty string for nulls.
Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.
In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!