Forum Discussion

mmethod's avatar
mmethod
New Contributor
10 years ago
Solved

An easy question related to the 'context' of my test step :)

Dear Experts,

 

I am new to this forum!  I had no other choice than registering as I am completely lost :)

 

I have been trying for days now to get test steps properly executed using a SoapUI Groovy script.

 

I have a test suite containing a single test case running one and only main script (Groovy) controling the entire flow of my test scenarios.

 

My requests are containing some property placeholders like ${#TestCase#PropertyX}.

 

Test cases are correctly executed and properties filled.

 

Instead of executing test cases I tried to execute each test step inside a specific test case one by one.

 

Steps are executed but property expansion doesn't work properly.  Requests are sent with some empty values.

 

According to me context isn't correctly set while executing steps.  It seems steps are executed but test runner is looking for properties somewhere else (in another test suite/case maybe?).  Reason why some of them can't be found resulting in empty values.  Probably test case execution works fine because properties are directly linked to it...

 

I tried so many things but nothing works.  Maybe it's due to ${#TestCase#PropertyX} referring to the wrong TestCase?  Maybe I have to clearly set the context of test runner before executing a specific test step in another test suite/case?

 

I think answer is quite obvious even if I didn't get it solved for now :(

 

Without going too much into details here are some lines of my code:

 

 

(...)

 

def reusableActionTestCaseSteps = reusableActionTestCase.getTestStepList()

 

(...)

 

reusableActionTestCaseSteps.each{
   tried this by doesn't work: myTestStepResult = it.run(testRunner, context)

   tried this by doesn't workmyTestStepResult = testRunner.runTestStep(it)
   tried this by doesn't work:

      def runner = it.run(null,true)

      runner.waitUntilFinished()

 

Steps are executed but placeholders aren't replaced by property values.

 

The following works fine:

 

reusableActionTestCase.run(properties, async)...

 

...but I don't want to execute a test case but steps inside of it!

 

Please help!

 

Thanks a lot in advance...

 

Best Regards,

 

Michael