cancel
Showing results for 
Search instead for 
Did you mean: 

Populate DataSource with Groovy

Buschfunk
Frequent Contributor

Populate DataSource with Groovy

Hello,

I have a DataSource test step in grid mode. Is it possible to populate (add rows, delete rows) this data source with Groovy? I couldn't find any information in the API documentatio.

Sincerely,
weeman
5 REPLIES 5

Re: Populate DataSource with Groovy

Hi,

try the following;

def model = testRunner.testCase.testSteps["DataSource"].dataSource.gridModel

the javadoc for this is at http://www.soapui.org/apidocs/pro/com/e ... Model.html

use the insertRows( rowIndex, nrOfRows) method to add rows (rowIndex of -1 appends)

regards,

/Ole
SmartBear Software


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Buschfunk
Frequent Contributor

Re: Populate DataSource with Groovy

Ah, great. I will give it a try. In the meantime I have written the data to a DataSink which becomes the new DataSource. But I do like your script better

Re: Populate DataSource with Groovy

cool - the DataSink -> DataSource solution is a good idea also!

/Ole
SmartBear Software


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
krabhishek_30
Occasional Contributor

Re: Populate DataSource with Groovy

Hi, this link does not work. Do you have any updated link for this ?

 

My use case, i want to write values to different columns in grid type data source.

msiadak
Community Hero

Re: Populate DataSource with Groovy

@krabhishek_30: Is this the link you were looking for? https://support.smartbear.com/readyapi/apidocs/pro/com/eviware/soapui/impl/wsdl/teststeps/datasource...




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors