cancel
Showing results for 
Search instead for 
Did you mean: 

Holding Object at TestCase level

Highlighted
Contributor

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 3
Highlighted
Super Contributor

Re: Holding Object at TestCase level

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
Highlighted
Contributor

Re: Holding Object at TestCase level

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.
Highlighted
Super Contributor

Re: Holding Object at TestCase level

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
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors