Forum Discussion
Cizo89
13 years agoFrequent Contributor
Hi,
I've tried this in my SoapUI Pro and I found out that there is a problem which will block you - http://forum.soapui.org/viewtopic.php?f=4&t=22213&sid=ba7f6da2d983c11c9c61513dfb5fb928.
So, as soon as the SoapUI devs fix that potentional bug, you could try this:
1. Configure the DataSource for your excel file
2. Put this into Groovy script TestStep:
3. Create DataSource Loop TestStep (target step will be the Groovy script)
4. Create, configure (both "File" and "Out File" fields and put Property Expansion to the Start at Cell field) and disable DataSink TestStep
I hope it will help you
Regards,
Marek
I've tried this in my SoapUI Pro and I found out that there is a problem which will block you - http://forum.soapui.org/viewtopic.php?f=4&t=22213&sid=ba7f6da2d983c11c9c61513dfb5fb928.
So, as soon as the SoapUI devs fix that potentional bug, you could try this:
1. Configure the DataSource for your excel file
2. Put this into Groovy script TestStep:
def dataSource = testRunner.testCase.testSteps["DataSource"]
def dataSink = testRunner.testCase.testSteps["DataSink"]
String Id = context.expand( '${DataSource#Id}' )
String StartAvailability = context.expand( '${DataSource#StartAvailability}' )
String EndAvailability = context.expand( '${DataSource#EndAvailability}' )
if (Id == "2"){
dataSink.setPropertyValue("Id", "edited_Id")
dataSink.setPropertyValue("StartAvailability", "edited_sa2")
dataSink.setPropertyValue("EndAvailability", "edited_ea2")
//I'm using the TestCase property, because the DataSink class doesn't have a setStartAtCell method
//because I'm using A1 row as the header
testRunner.testCase.setPropertyValue("rowToUpdate", "A" + (dataSource.getCurrentRow() + 1).toString())
testRunner.runTestStepByName("DataSink")
dataSource.restart(testRunner, context)
}
3. Create DataSource Loop TestStep (target step will be the Groovy script)
4. Create, configure (both "File" and "Out File" fields and put Property Expansion to the Start at Cell field) and disable DataSink TestStep
I hope it will help you
Regards,
Marek