Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

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

  • omatzura's avatar
    omatzura
    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