Forum Discussion

dazed's avatar
New Contributor
12 years ago

Passing HTTP Session state between Groovy-based components


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.


2 Replies

  • 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).


    Henrik O
    SmartBear Software
  • dazed's avatar
    New Contributor

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