[SOLVED]How can we set values for a property in Data Source from Groovy Script?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2009
06:29 AM
09-16-2009
06:29 AM
[SOLVED]How can we set values for a property in Data Source from Groovy Script?
I have a Data source using Grid. This has 2 rows in it with the property name as 'RefId'.
What I want to do is set the values for 'RefId' for the two rows using Groovy script.
How can we do this?
What I want to do is set the values for 'RefId' for the two rows using Groovy script.
How can we do this?
6 REPLIES 6
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2009
01:38 PM
09-16-2009
01:38 PM
Hi Claire,
please try
def model = testRunner.testCase.testSteps["DataSource"].dataSource.gridModel
model.setValueAt( "1", 0, 0 )
model.setValueAt( "2", 1, 0 )
Does that work ok?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
please try
def model = testRunner.testCase.testSteps["DataSource"].dataSource.gridModel
model.setValueAt( "1", 0, 0 )
model.setValueAt( "2", 1, 0 )
Does that work ok?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2009
10:58 PM
09-17-2009
10:58 PM
Hi Ole
It worked
Thanks
It worked

Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
03:37 AM
10-16-2009
03:37 AM
Hi
Is there a way I can get the values at a cell location in the data source?
I tried
def model = testRunner.testCase.testSteps["DataSource"].dataSource.gridModel
model.getValueAt( 0, 0 )
but it did not work.
Regards
Shalabh
Is there a way I can get the values at a cell location in the data source?
I tried
def model = testRunner.testCase.testSteps["DataSource"].dataSource.gridModel
model.getValueAt( 0, 0 )
but it did not work.
Regards
Shalabh
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
03:44 AM
10-16-2009
03:44 AM
Hi,
the gridModel is a standard swing TableModel so getValueAt( row, column ) should work just fine.. in what way did it not work for you?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
the gridModel is a standard swing TableModel so getValueAt( row, column ) should work just fine.. in what way did it not work for you?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
04:21 AM
10-16-2009
04:21 AM
Hi
I am using it in Script assertion. It does not work there.
It work in Groovy Script though.
Regards
Shalabh
I am using it in Script assertion. It does not work there.
It work in Groovy Script though.
Regards
Shalabh
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2009
04:28 PM
10-18-2009
04:28 PM
Hi!
ah.. in a script assertion you do not access to the testRunner, you need to use
def model = messageExchange.request.testStep.testCase.testSteps["DataSource"].dataSource.gridModel
model.getValueAt( 0, 0 )
instead.. does that help?
regards,
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
ah.. in a script assertion you do not access to the testRunner, you need to use
def model = messageExchange.request.testStep.testCase.testSteps["DataSource"].dataSource.gridModel
model.getValueAt( 0, 0 )
instead.. does that help?
regards,
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
