Hi,
I’m testing the API sending direct API requests(without using the browser).
In order to authenticate, I have to add the http header Cookie value with LoginToken that changes at every request.
I tried to set a GlobalVariable.gl_Cookies with the cookie value, but not sure how I can pass this value to the Web service Request Object so that WS.verifyResponseStatusCode(response, 200) passes.
There is an option in Katalon to set the http header Cookie manually via the Object Repository, but I want this process to run automatically.
Indeed this article was helpful. However, it seems that a single function which would have dealt with the cookie would have saved me the requirement to manually create an API request and its verification functions.
Is there any other alternative just for setting the http cookie header function?
I currently have an Object similar to the SampleRequestObject from the article you sent so I can set the http cookie header dynamically, and wanted to use verifyResponseStatusCode() or verifyElementPropertyValue functions.
A way for a newby like me does this is that I
1. Login to my website with my credentials and get the cookie.
2. Create a Global variable for the cookie.
3. Create a Web Service Object.
4. Click the Variables tab and create a variable which is bound to the global variable, like so:
5. Click the Http Header tab and add a cookie under the Http Header tab, like so:
I have a scenario like same as you have but with slight deviation,
1.For login we have an api and for submit otp we have another api. After the submit OTP call, when the dashboard of the application launches, a cookie gets generated. How to fetch this cookie value and give in the header of the rest of API’s .
2.How to fetch this cookie value and store in the global variable and use for other API’s which are dependent to run with the cookie other wise it will fail.
I am stuck with the same scenario, I have WS object in object repository and want to pass the cookies header dynamically on test run. Can you please help me?
And also the link you shared in previous comment, when clicked on it shows me 404 page not found error.