readyAPI feature - automatic passing cookies to following request with “Maintain HTTP Session”SOLVED
readyAPI feature - automatic passing cookies to following request with “Maintain HTTP Session”
I'm on ReadyAPI 3.9.0 (trial).
Have seen documentation and tried to use “Maintain HTTP Session” https://www.soapui.org/docs/soapui-projects/form-based-authentication/#_ga=2.117081990.1241344506.16...and other questions on the https://community.smartbear.com/t5/SoapUI-Open-Source/
I use Add a Header with a key name Cookie to a Request and set the Value to
to get auth cookies in the request headers.
But the order of the Headers in the HarResponse json is not constant and  in my case is a variable list element index that is not comfortable during automated tests.
Groovy scripting is ok but again to repeat a script for each step is inconvenient and boring in comparison with Postman or a web browser style of normal (automatic) Set-Cookie.
More over the manual adding a Cookie section to the request headers doesn’t allow the testers (for which readyAPI has been developed) to test a “Set cookies” workflow that is not good for the specialized software that is readyAPI.
It looks like many things for start working with or migrating to readyAPI were not in a focus in the documentation...
Could you show me the easiest way to automate Set-Cookie as a result of a server response or tell me where I’m wrong with “Maintain HTTP Session” option? Hope the issue is not the case of a trial version.
Solved! Go to Solution.
Update. To those who are switching from Postman.
A readyAPI feature.
Automation with “Maintain HTTP Session” works fine ONLY when one runs test steps as a Test Case and doesn't work when running test steps one-by-one (for example if you try debugging a test step like in Postman). For the debug purpose in “Maintain HTTP Session” mode there are a "bug" button (next to a run button under the TestCase name) and a "Step-by-Step Run" tab.
There is lack of warnings for the feature in the docs. A lot of time has been wasted to get it worked.
Thanks for the link @nmrao. I've already googled this solution and that is exactly I have mentioned in my root post (about Groovy script).
Please see if the below link helps
But the question is simple how to debug or write a Test Case with “Maintain HTTP Session” having a bunch of test steps in a serie??? May be the answer is too simple...
I dont know if ive misunderstood, but from what youve said, it sounds like the "maintain http session" checkbox isnt working properly.
The script @nmrao mentioned or one very similar, he actually put together for me a while back when i had to do this. Immediately after he'd coded it i discovered the maintain http session option. It did and should identify the set-cookie header from a request's response and then add >= cookie (relative to how many ; separated values were sent on the set-cookie) to all other requests hitting the same domain.
Is this not happening with you?