Forum Discussion
You can find some sample on how to read the value of jdbc using groovy script:
http://stackoverflow.com/questions/31472381/dynamically-compare-rest-xml-json-response-and-jdbc-using-groovy-array-in-soapui/35706976#35706976
Hoping that at least, you know how to use those values later. The above one allows to proceed, I guess.
I'm really sorry about that. I'm sure is because I'm totally clueless about SoapUI, testing and programming in general, and English not being my mother tongue does not help either.
I'll try to formulate in another way: I have a JDBC step which returns several nodes with child-nodes as an XML response. I want to store this information into an 'arrays of arrays' so later I can access this data from a Groovy Script.
Perhaps this piece of code can help me to explain what I'm trying to do:
// Create an empty list to store csv file info def testDataSet = [] // Load the csv file def fileName = "C://SoapUI Projects//Data//test.csv" // Opens the file, iterates through each line and splits the line on the commas into an array new File(fileName).eachLine { line -> testDataSet.add( line.split(",") ) } // Select a random line def index = (int)Math.random()*testDataSet.size() def testDataLine = testDataSet[index] // Assign their value to the Test Case Property fields def props = testRunner.testCase; props.setPropertyValue("valueOne", testDataLine[0]) props.setPropertyValue("valueTwo", testDataLine[1]) props.setPropertyValue("valueThree", testDataLine[2])
In that particular case, the index is randomly selected which won't work for me. I need some way to store the information in a list so later I can access all the values that are stores on the nth index. I hope this clears up what I'm trying to do.
Anyways, thank you so much for your reply! I appreciate it!
- nmrao8 years agoChampion Level 3Hmm. would it be possible to show the screen shots of test case structure, and the request you want to use retrieved values from jdbc step response.
Related Content
- 10 months ago
- 5 years ago
- 6 years ago
- 2 years ago
Recent Discussions
- 15 years ago