Ask a Question

Groovy script to create Test cases with test steps

senthil1
Occasional Contributor

Groovy script to create Test cases with test steps

Hi 

I am trying to create 50 Test cases. I need to change only few parameters in each test step. I am requiring to create a groovy script which creates Test Cases. Is there any link which I can refer to?

 

Regards

Senthil

7 REPLIES 7
nmrao
Community Hero

Can you please elaborate your use case?


Regards,
Rao.
senthil1
Occasional Contributor

Hi 

 

I need to create 50 test cases like the test case in the image, with change in values with Properties test step. If I have a groovy to do this, without manually creating each test case with change in properties file.   

 

 

soapui msg.PNG

I am not sure if the problem I got it right.

Is not it candidate for the data driven instead of copying them to 50 times?


Regards,
Rao.
senthil1
Occasional Contributor

I am looking something more like this

http://community.smartbear.com/t5/SoapUI-NG/creating-groovy-teststep-with-code-via-groovy/m-p/15147#...

 

This is very basic, if I am copy a test case, then edit using groovy script, will make my life easier.

 

Regards

 

Well, may be not able to get your point.

It was mentioned in earlier comment that there is values changes for different test cases, so need to copy 50 cases.

I still believe that the data driven is best for this need and have all the test case specific values in the data source (excel ?) a row for a test case and loop it thru the rows. That way, you can even scale it for 100's of tests.


Regards,
Rao.
bs01
Occasional Contributor

Data driven is the answer for this, however, Soapui can not support the Html  results in this apporach.

We tried this apporach to avoid duplication of code, but due to the problem (it does not write Html results as step-wise, rather test case-wise) with Soapui, we gave it up.

 

Created each step as a test case, now we are able to get the results in .HTML format. The tool should be modified to meet the requirements.

senthil1
Occasional Contributor

Hi

 

I was away, and I was not able to respond earlier.

 

with one testcase created manually in the testsuite, I took the testcase.xml and modified, created copies. This works for me. I can do semi automatic now, which is ok for me. 

 

Regards,

Senthil

cancel
Showing results for 
Search instead for 
Did you mean: