Contributions
Looping datasources in Groovy
I have 2 datasources in my test the first "DataSourceRESTData" supplies data for builing a REST request but before I execute the REST request I needto validate some of this dataagainst a column in my 2nd data source "DataSourceValidEntries". I want to loop though each row in the "DataSourceValidEntries" to verify thedata form "DataSourceRESTData" using Groovy Looping through "DataSourceRESTData" works fine and the the first time the method below is executed... all column entries get printed but on the second loop around only the last value get printed 5250 times. boolean isValid(checkifValid){ //testRunner.testCase.getTestStepByName('DataSourceValidEntries').repositionAtStartRow( testRunner, context) //Doesn't seem to rest the row number in DataSourceValidEntries def ds = testRunner.testCase.getTestStepByName('DataSourceValidEntries') //def rowsToRead = testRunner.testCase.getTestStepByName('DataSourceValidEntries').size; //This doesn't work so its hard coded below def rowsToRead = 5250; for (row in 1..rowsToRead) { def colvalue = ds.getPropertyValue('ABC'); log.info "Column Value: " + colvalue; testRunner.testCase.getTestStepByName('DataSourceValidEntries').next(testRunner, context) if(colvalue.equals(checkifValid)){ log.info "Found: " + checkifValid; return true; } } return false; } I've looked at the tips and tricks section for groovy but cant seem to figure this out. What am I missing? Regards Sod9 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes5Comments- 9 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.6KViews0likes1Comment
Using custom jar in groovy script
Hi all, I am trying to useacustom jar in a groovy test script but I get the error org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script4.groovy: 1: unable to resolve class xxx.yyyy.util.Util @ line 1 when my script calls import xxx.yyyy.util.Util; I have added the relevant jar to: C:\Program Files\SmartBear\ReadyAPI-1.4.1\jre\lib C:\Program Files\SmartBear\ReadyAPI-1.4.1\bin\ext Restarted ReadyAPI What am I missing or doing wrong? Any help much appreciated ThanksSolved9 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.6KViews0likes3Comments