Forum Discussion
nmrao
8 years agoChampion Level 3
Have you looked at "Conditional GoTo" test step?
- AndreW273SK8 years agoNew Contributor
Conditional GoTo is not realy an option in this case, becasue it checks the response, and the property I need to check against is in request.
Andrej
- nmrao8 years agoChampion Level 3Oh ok. So, what is the issue with script that you have (could not go thru it)?
- AndreW273SK8 years agoNew Contributor
Well, after executing the script, the flow continues to the next step, without running desired step.
The code looks like this now:
def CC1 = testRunner.testCase.testSuite.getPropertyValue("CC1") log.info testRunner.testCase.testSuite.getPropertyValue("CC1") switch(CC1) { case ~/(.)*?[H1]/: log.info('PT02_H1'); testRunner.runTestStepByName( "PT02_H1" ); break; case ~/(.)*?[Y5]/: log.info('PT02_Y5'); testRunner.runTestStepByName( "PT02_Y5" ); break; case ~/(.)*?[Q2]/: log.info('PT02_Q2'); testRunner.runTestStepByName( "PT02_Q2" ); break; case ~/(.)*?[T5]/: log.info('PT02_T5'); testRunner.runTestStepByName( "PT02_T5" ); break; default : log.info('testing PT02_AQ'); testRunner.runTestStepByName( "PT02_AQ" ); }