Forum Discussion
AnandKiran
16 years agoFrequent Contributor
Hi cvalston ,
It is possible to do using a single groovy script.
Just follow these steps:
1 . Put the groovy script in a single test case Say for Example Name the test case as " Groovy Holder "
(" Groovy Holder " - This script should update the ser:ConsumerId value based on your test case name) Under this Test Case place your Request too.
2 . Then you create a another test case name it as "TestCase1" and add one groovy script to this step which should pass the Name of the TestCase to the " Groovy Holder ", Then " Groovy Holder " will update Value of ser:ConsumerId for TestCase1( In TestCase1 you will have only one step which contains a groovy script )
So you can create N no of testcases at ease. Now you have only two groovy scripts. The main script is your " Groovy Holder " and another script is in your testcase.
Note : Use Excel or DataSource to hold ser:ConsumerId for 25 testcases and try to call this sheet in " Groovy Holder" step.
Hope that answers your question.
With Regards
Anand
It is possible to do using a single groovy script.
Just follow these steps:
1 . Put the groovy script in a single test case Say for Example Name the test case as " Groovy Holder "
(" Groovy Holder " - This script should update the ser:ConsumerId value based on your test case name) Under this Test Case place your Request too.
2 . Then you create a another test case name it as "TestCase1" and add one groovy script to this step which should pass the Name of the TestCase to the " Groovy Holder ", Then " Groovy Holder " will update Value of ser:ConsumerId for TestCase1( In TestCase1 you will have only one step which contains a groovy script )
So you can create N no of testcases at ease. Now you have only two groovy scripts. The main script is your " Groovy Holder " and another script is in your testcase.
Note : Use Excel or DataSource to hold ser:ConsumerId for 25 testcases and try to call this sheet in " Groovy Holder" step.
Hope that answers your question.
With Regards
Anand