Forum Discussion
SmartBear_Suppo
Alumni
16 years agoHello,
It seems to me like you wish to run the DataSink a total of three times, once for each row you wish to enter. If this is the case, then you need to manually run the DataSink TestStep using a groovy script. You can try the following:
First, disable the DataSink TestStep. Since we will be running it manually inside a loop, we do not with it to be run by the soapUI TestRunner as well. If you do not disable the step, the last row will be added twice.
Second, modify the groovy script to run the DataSink with each row:
Hope this helps!
Regards,
Dain
eviware.com
It seems to me like you wish to run the DataSink a total of three times, once for each row you wish to enter. If this is the case, then you need to manually run the DataSink TestStep using a groovy script. You can try the following:
First, disable the DataSink TestStep. Since we will be running it manually inside a loop, we do not with it to be run by the soapUI TestRunner as well. If you do not disable the step, the last row will be added twice.
Second, modify the groovy script to run the DataSink with each row:
...
string array1 = ['Vehicle is of type Car', 'Vehicle is of type Scooter', 'Vehicle is of type Truck']
string array2 = ['Vehicle is of type Cycle', 'Vehicle is of type Bike', 'Vehicle is of type Van']
def sink = testRunner.testCase.testSteps['DataSink'] //Replace with the name of your DataSink TestStep
for( i in 0..array1.size ) {
sink.properties['prop1'].value = array1[i] //Replace prop1 with the column name you're using in the TestStep
sink.properties['prop2'].value = array2[i] //Replace prop2 with the column name you're using in the TestStep
testRunner.runTestStepByName('DataSink') //Replace with the name of your DataSink TestStep
}
Hope this helps!
Regards,
Dain
eviware.com