Forum Discussion
richie
5 years agoCommunity Hero
Hey dedmunds,
Theres lots of ways to do this. The easiest i suggest is adding 2 new test steps at the start of your test case.
First new test step is JDBC step: select count(*) from table;
Second new test step would be the Conditional GoTo step which uses XPATH and set this to jump to the final step in test (that could be a placeholder cos the goto step doesnt support jumping to adifferent testcase) IF zero rows were returned in first JDBC step or jump to next test case (skipping all other steps in test)
OR
Add 2 new test steps at the start of your test case.
First new test step is JDBC step: select count(*) from table;
Second new test step is Groovy step with conditional goto like "if jdbc response is zero rows, jump to next testcase (skipping all other steps in testcase), else jump to next JDBC step (which was the original first step).
As im sitting here other ways of doing this are popping in my head. Im sure the other forum members will have various other options
Cheers
Rich
Theres lots of ways to do this. The easiest i suggest is adding 2 new test steps at the start of your test case.
First new test step is JDBC step: select count(*) from table;
Second new test step would be the Conditional GoTo step which uses XPATH and set this to jump to the final step in test (that could be a placeholder cos the goto step doesnt support jumping to adifferent testcase) IF zero rows were returned in first JDBC step or jump to next test case (skipping all other steps in test)
OR
Add 2 new test steps at the start of your test case.
First new test step is JDBC step: select count(*) from table;
Second new test step is Groovy step with conditional goto like "if jdbc response is zero rows, jump to next testcase (skipping all other steps in testcase), else jump to next JDBC step (which was the original first step).
As im sitting here other ways of doing this are popping in my head. Im sure the other forum members will have various other options
Cheers
Rich
- dedmunds5 years agoNew Contributor
I added the JDBC count step and a groovy script with a conditional "testRunner.gotoStepByName", and it looks like it's working the way I want. Thanks for the help!
Related Content
- 11 months ago
- 4 years ago
- 2 years ago