cancel
Showing results for 
Search instead for 
Did you mean: 

Gettting Context.ThreadIndex

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

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:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors