cancel
Showing results for 
Search instead for 
Did you mean: 

Gettting Context.ThreadIndex

Super Contributor

Gettting Context.ThreadIndex

Hello,
When I type context.ThreadIndex in the soapUI groovy console and run it, I get 0.

However, If I have a external groovy file with the following function

void test()
{
    context.ThreadIndex;
}

soapui throws an error
groovy.lang.missingPropertyException: No such property: context for class: GlobalFunctions

Can you please help.

Thanks
1 REPLY 1
Super Contributor

Re: Gettting Context.ThreadIndex

Hi,

you'll either need to pass the context as argument to your method,ie replace

void test()
{
    context.ThreadIndex;
}

with

void test( context )
{
    context.ThreadIndex;
}

pr you could also provide the context when constructing the above object, and save it as a class variable..

Hope this helps!

regards,

/Ole
eviware.com
New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors