Forum Discussion

haiintel's avatar
New Contributor
8 years ago

The request run 2 times

Hi All,


I'm new to SoapUI, and I'm trying to create data driven test with free SoapUI tool with this service following this guide


However, my request always run 2 times, I don;t know why.


Please help me, here is test case Setup script:


//Create a new filereader object, using the context variable so it can be used between test components
context.fileReader = new BufferedReader(new FileReader("D:/data.txt"))
//Read in the first line of the data file
firstLine = context.fileReader.readLine()
//Split the first line into a string array and assign the array elements to various test case properties
String[] propData = firstLine.split(",") propData[0]


The Read Data script:

/*Read in the next line of the file
We can use the same fileReader created in the Setup script because it
was assigned to the context variable.*/
nextLine = context.fileReader.readLine()
/*If the end of the file hasn't been reached (nextLine does NOT equal null)
split the line and assign new property values, rename test request steps,
and go back to the first test request step*/
if(nextLine != null){
String[] propData = nextLine.split(",")
curTC = testRunner.testCase propData[0] propData[1]


This is the script assertion:


responsexmlholder = new XmlHolder(messageExchange.getResponseContentAsXml())

Cdataxml = responsexmlholder.getNodeValue("//*:GetCountryByCountryCodeResult")
Cdataxmlholder = new XmlHolder(Cdataxml)
country = Cdataxmlholder.getNodeValue("//name")

assert country == context.expand('${#TestCase#countryName}') "right dddddd ${country}"



Many thanks for your time,