Forum Discussion
... and an example of setting the end row via Groovy:
// Example run from Groovy Script test step def dataSourceTestStep = testRunner.getTestCase().getTestStepByName("DataSource") dataSourceTestStep.setEndRow("5")
Note: The data source test step is the class WsdlDataSourceTestStep.
Radford Thanks a lot for your answer!
And, do you know how to set "DataSource - Number of Rows" property from groovy?
Thant would also be great to have.
Regards,
Joaquin.
looking at the methods on the 'WsdlDataSourceTestStep' page Radford mentioned, there are a lot less set methods than get methods.
There doesn't appear to be anything equivalent to "set number of rows" - but there is a setStartRow() method - could you not use this in conjunction with the setEndRow() to set the "number of rows"? I could be totally wrong - I'm new to all this "look at the API docs to work out the method you need thingy"
ta,
rich
jcabelloa, I'm not sure I understand what you are refering to when you say "DataSource - Number of Rows"? Do you mean the "Rows Per Iteration" option? If so I think you need:
// Example run from Groovy Script test step def dataSourceTestStep = testRunner.getTestCase().getTestStepByName("DataSource") dataSourceTestStep.setRecordsPerIteration(1)
Radford Is it possible to set the DataSource row at the project level in a startup script?
Note: You are asking a different question, it's probably best to start a new topic.
I assume you mean the start row?
I don't have time at the moment to test this, but I think you need something like:
// Example run from Project Setup Script def dataSourceTestStep = project.getTestSuiteByName("Your Test Suite Name").getTestCaseByName("Your Test Case Name").getTestStepByName("DataSource") dataSourceTestStep.setStartRow("2")