I'm new to groovy script and what I'm trying to do is not working. What I try to do is:
- Read a .csv file
- Add the data from from the .csv file to a variable that I can use in XML (e.g.
test.csv name,age Tester,20 Java,30
and use the Tester in a variable named name in the XML and 30 in a variable named 20)
Which software / jar files do I use:
OpenCSV v3.9 jar file added to the SoapUI directory: bin/ext
GroovyCSV v1.1 jar file added to the SoapUI directory: bin/ext
SoapUI 5.2.1.
I searched Google on how to do this and used the following code to try to get it working:
@Grab('com.xlson.groovycsv:groovycsv:1.1')
import static com.xlson.groovycsv.CsvParser.parseCsv
def csv = '''Name,Lastname
Mark,Andersson
Pete,Hansen'''
def data = parseCsv(csv)
for(line in data) {
println "$line.Name $line.Lastname"
}
This is what I used to see if everything is working but I am getting the following error code:
java.lang.noclassdeffounderror: org/apache/ivy/core/settings/Ivysettings
I searched Google for this but couldn't really find a good solution, please advise.
@Grab- tim_yates