Forum Discussion

Raju_Vusirikala's avatar
Raju_Vusirikala
Contributor
16 years ago

Holding Object at TestCase level

Hi,

In my test case I have following test steps
1. Soap TestRequest
2. Groovy Script
3. Soap TestRequest
4. Groovy Script

Here In step 2 - Groovy Script I am preparing XXXObject (extends from java.lang.Object)  and I would like to use this XXXObject in step 4 - Groovy Script.

Could you please help me on this.

Thanks
Raju.

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you can just save it to the context, which is a StringToObject map, ie in step 2

    context.myObj = ...

    and in step 4

    def myObj = context.myObj


    regards!

    /Ole
    eviware.com
  • Hi Ole,

    Your solutions works greate, but one short of excuting only step-4 after initial execution for debugging.

    Like when I tried to execute only step-4 for debugging after initial execution of steps1 to 4. it gives me null object in step-4

    Thanks
    Raju.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Raju,

    yes.. this is how it works currently, context objects are only "kept" between teststeps when running the entire testcase.. sorry..

    regards,

    /Ole
    eviware.com