Eviware Forum

soapUI => soapUI => Topic started by: anu on August 22, 2008, 01:13:29 am



Title: Running a Test Case from groovy script
Post by: anu on August 22, 2008, 01:13:29 am
Hi Ole

I want to run a test case. For that I have coded the following. But, I get compilation error. Can you pl. help me

testRunner.getTestCase().getTestStepByName("Step getSessionid").run(testRunner, context);
       
println("Finished Executing:");
              List stepResult=testRunner.getResults()
             Iterator j=stepResult.iterator();
             while (j.hasNext())
            {
                  TestStepResult result=(TestStepResult)j.next();
                  println("result:"+result.getStatus())
            }

The error is in "TestStepResult result=(TestStepResult)j.next();"

Also can you explain me why is testrunner being passed as parameter in the run method?

Thanks
Anu


Title: Re: Running a Test Case from groovy script
Post by: omatzura on August 24, 2008, 10:10:23 pm
Hi Anu,

just to make sure; you are running a TestStep, not a TestCase here..

Can you show the actual compilation error so I can get a better understanding?

If you want to know why the testRunner is being passed as an argument to the TestStep.run method, I kindly ask you to have a look at the source-code, you will see how it is used :-)

regards!

/Ole
eviware.com