Forum Discussion
yuraku
Contributor
Thanks for your reply. But it doesn't work for me.
This is my code:
if ('false' == responseObject.Successful){ testRunner.gotoStepByName( "Check Job Status")} else{ testRunner.gotoStepByName( "Get Job Result")}
it still goes to the second step instead of first one.
yuraku
8 years agoContributor
Any updates on this?
- axeltoushirou8 years agoContributor
Hi, I think because your assertion is "Existence" meaning that it expects to see the "Successful" node in the response, whatever the value of the node is as long as it is displayed in the response, it will always be true.
For the script, I suggest use Conditional Goto step it is easier and you don't have to write alot.
just get the XML Node and use something like:
exists(//insert node here)
//insert node here = 'True'
- axeltoushirou8 years agoContributor
if you want groovy try this, just edit the script
def result = context.expand( '${Test Step Name Here#Response#$.Successful}' )
if ((boolean)result){ // if true testRunner.gotoStepByName( "Check Job Status")} else{ // if false or null testRunner.gotoStepByName( "Get Job Result")}- yuraku8 years agoContributor
Still no luck