0

I don't have soap ui pro. I am testing the web service. The actual implementation is i need pass one error code on the request, and the corresponding error description should be displayed on the response. I need to add this assertion. Every time the description in the response varies.

Here is the thing i want exactly...

Every time i need to run the same request but the error code (which is input) only should be changed on each time and the description varies on the response. How to validate this? Is there any way to do this without data source.

Regards, Chandra

4

1 回答 1

0

这就是我创建的方式..有没有办法改进代码以做得更好;

import java.io.File;
File file = new File('c:/customers.csv');
InputStream inputFile =  new FileInputStream(file);
String[] lines = inputFile.text.split('\n');
List<String[]> rows = lines.collect {it.split(',')}
log.info('There are ' + rows.size() + ' customers to be inserted');
for(int i = 0; i < rows.size(); i++) {
  String[] row = rows.get(i);
  String errorcode = row[0];
// log.info(errorcode)
 String errorDescription = row[1];
 //log.info(errorDescription)
testRunner.testCase.testSuite.project.setPropertyValue('errorcode', errorcode);
testRunner.testCase.testSuite.project.setPropertyValue('errorDescription', errorDescription);
testRunner.runTestStepByName("createCard-1");
log.info(errorcode +"Finsihed")
}
于 2012-06-10T03:59:42.253 回答