Ask a Question

Failing test cases

SOLVED
Markal
Occasional Contributor

Failing test cases

Hi!
I'm working with SOAPUI NG PRO and ran into the following issue:
In a test case I have many test steps. I would like to create a "hierarchy" between them. So for example:
testStep4 - checks if a field exists in the response

testStep4.1 - counts if the field is only present once

testStep4.2 - checks the value of the field

testStep5 - next main test step

 

If testStep4 fails I would want to:

1. Fail 4.1 and 4.2 without executing them

2. Continue from testStep5

 

branchingpath.png


I have a groovyscript (branching path1) which decides what to do. It's after testStep4. I can do the skipping part by: testRunner.gotoStepByName("testStep5") but I couldn't find a solution for setting testStep4.1 and 4.2 to failed. I googled it but could not find a solution.

How would you guys take care of this? Or if you have any idea how to work around this, please tell me!
Thanks!

5 REPLIES 5
nmrao
Community Hero

May be you forgot one thing, if testStep4 is failed, then the next groovy script is not even executed, is not it so?


Regards,
Rao.
Markal
Occasional Contributor

The script runs if testStep4 fails. This is how I know the jump works correctly.

Markal
Occasional Contributor

Any other suggestion? Or can you point me to a direction where I might find a solution to this problem?

nmrao
Community Hero

Place the groovy script first.
Then run the step4 from groovy.
Evaluate the conditions as you needed.


Regards,
Rao.
axeltoushirou
Contributor

Try using "Conditional Goto" testStep make a condition for each posibility using xpath expression. I think that's a better way.

cancel
Showing results for 
Search instead for 
Did you mean: