Unable to maintain session between Test Suites.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unable to maintain session between Test Suites.
I am trying to modularize my test cases. For example there are 4 test suites(A,B,C,Lib)
'Lib' testsuite contains Login to session and other common functions(testcases) which are called from other TestSuits(A,B,C) .
I want to maintain the session created in 'LIb' across all my other Testsuites.
Tried-
1. enable "Maintain HTTP Session"
2. Copy HTTP Session under "Run Test cases options"
3. Added cookies in Header via "Events" tab.(https://support.smartbear.com/readyapi/docs/testing/scripts/samples/headers.html)
None of the above solution worked.
How can I maintain the same session across the TestSuits?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried sending the cookie via Header, but while running the test case multiple instances of "Cookie" headers were created.
Is there any other way to maintain a single session across all the Test suites?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the same cookie to be used for all the steps spread across test cases and suites?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In 'Lib' testsuite, we extract and save the session ID to a variable using groovy script.
Then I add header parameter named 'cookie' to all my API requests and pass the variable value.
I am able to execute my tests this way.
Issue: I have to update my API's everyday. While I do this I need to keep adding Header parameter to all my API's,which is a gruesome process.
yes,I need to use the same cookie across all the test cases and test Suits.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After running "Login" test case, I extract the session ID from the Login response header.
def harResponse = context.expand( '${#[Lib#startSession#login]#HarResponse#$[\'headers\'][7][\'value\']}' )
I then pass this value to cookie parameter in my API requests.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use this project level value in the Events to set a cookie.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It will be helpful if you could provide the steps to resolve the issue.
