cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear all existing properties of a data source using groovy code?

Highlighted
Occasional Contributor

How to clear all existing properties of a data source using groovy code?

Hi,

 

Is there a way to clear all existing properties of a data source using Groovy code?

 

Thanks,

Srini

1 REPLY 1
Highlighted
Community Hero

Re: How to clear all existing properties of a data source using groovy code?

What sort of data source do you have? The answer will be dependent on that. If you mean the "Data Log" at the bottom of the Data Source window, though, that isn't data that's held but just a log. Closing the Data Source window will clear that log. 

 

Here's a snippet of clearing a Grid data source of data though.

 

 

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


int rows = grid.getRowCount();

log.info(rows);

for (int i = 0; i < rows; i++)
{
	grid.deleteRows(0);
}

 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!