Ask a Question

Passing HTTP Session state between Groovy-based components

dazed
New Contributor

Passing HTTP Session state between Groovy-based components

Hi

With LoadUI - is there a way to pass on HTTP Session state from one Groovy-based HTTP Runner component to another?

I have a reasonably involved logon process to the site I want to test. I couldn't get this logon working with SoapUI, given a heap of non-static fields in the page, but have managed successfully with a Groovy script (outside of LoadUI) - hence the question about Groovy.

I'm new to LoadUI - and only went to Groovy when I saw it was available for use here.

I would like to be able to take a connected session from one component and then run a cycle of further tests, using another component. For this to work I'd need to retain access to all the usual cookie stuff and various url parameters - ideally I'd retain the HTTPBuilder object reference I'm using rather than have to rebuild all the internals, but suspect that isn't going to be possible.

Thanks
Dazed
2 REPLIES 2
PM_r
Staff

Yes, this is possible.

Use the Groovy Runner and make your Groovy script return the HTTP Session.
This will send along the session to the next component(s).

Regards

Henrik O
SmartBear Software
dazed
New Contributor

Henrik

Ok, that sounds straightforward - I'll give that a try.

Thanks
Dazed
cancel
Showing results for 
Search instead for 
Did you mean: