Forum Discussion

orion1's avatar
orion1
New Contributor
14 years ago

Can not use 'context' object when running a remote testStep

Hi,

Into the same project and in diffrent testSuites, I'm trying to run a testStep from my current testcase with the help of a groovy script. I'm doing something like that:

TestSuite testSuite = testRunner.testCase.testSuite.project.getTestSuiteByName("TestSuite2");
TestCase testCase = testSuite.getTestCaseByName("TestCase2);
WsdlGroovyScriptTestStep wsdlGroovyScriptTestStep = testCase.getTestStepByName("TestStep2");
wsdlGroovyScriptTestStep.run(testRunner, context);


The remote testStep is running, but i'm not able to defined some variables in ths testStep using the 'context' and 'testRunner' objects.

Fo example, if i try to define a new variable :

def newVariable = testRunner.testCase.getTestStepByName( "myStep" )  //


The value of this variable is set to null, and I guess it is because the 'testRunner' object is defined from my firt TestCase.

=> my question is: how can i defined new 'testRunner' and 'context' variables?

Thanks,
No RepliesBe the first to reply