gk30888
13 years agoOccasional Contributor
Text Data Source using Groovy error
Hi,
Can anyone help me , What is the actual error on this code ? I'm gave the same test case name in groovy but it is still showing groovy.missingproperty.Property not found.
Code:
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def folderName = "d:\\data\\532178548\\Desktop\\Samples" //to store the response
def createFolder = new File(folderName)
createFolder.mkdir()
def testSuite = testRunner.testCase.testSuite.project.testSuites["Flights"]
def testCase = testSuite.getTestCaseAt(0)
def testStep1 = testCase.getTestStepCount()
def xHolder = new XmlHolder(testCase.getTestStepAt(0).getProperty("Response").getValue())
File tempFile = new File("d:\\data\\532178548\\Desktop\\Samples\\data_source_file.txt")
List lines = tempFile.readLines()
def i=0
def temp1 = 0
def inputValue
def myTestStep
def myTestRunner
def myTestStepContext
//Loop through all the names of the test steps.
( 0..<testStep1 ).each
{ i=0
tempFile.eachLine
{
testCase.setPropertyValue("inputValue", lines[i++])
inputValue = context.expand( '${#TestCase#inputValue}' )
myTestStep = testCase.getTestStepAt(temp1)
myTestRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(myTestCase,null)
myTestStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(GetFlight)
myTestStep.run( myTestRunner, myTestStepContext )
xHolder = new XmlHolder(testCase.getTestStepAt(temp1).getProperty("Response").getValue())
f = new File( folderName + ‘/’ + inputValue + ‘_’ + testCase.getTestStepAt(temp1).getName().toString() + '.txt')
f.append("\r\n\r\n\r\n\r\n\r\n")
f.append("#################################################\r\n")
f.append("\t\t\t Response \r\n")
f.append("#################################################\r\n\r\n\r\n\r\n\r\n")
f.write(xHolder.prettyXml)
xHolder.clear()
}
temp1++
}
Regards,
- Karthik
Can anyone help me , What is the actual error on this code ? I'm gave the same test case name in groovy but it is still showing groovy.missingproperty.Property not found.
Code:
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def folderName = "d:\\data\\532178548\\Desktop\\Samples" //to store the response
def createFolder = new File(folderName)
createFolder.mkdir()
def testSuite = testRunner.testCase.testSuite.project.testSuites["Flights"]
def testCase = testSuite.getTestCaseAt(0)
def testStep1 = testCase.getTestStepCount()
def xHolder = new XmlHolder(testCase.getTestStepAt(0).getProperty("Response").getValue())
File tempFile = new File("d:\\data\\532178548\\Desktop\\Samples\\data_source_file.txt")
List lines = tempFile.readLines()
def i=0
def temp1 = 0
def inputValue
def myTestStep
def myTestRunner
def myTestStepContext
//Loop through all the names of the test steps.
( 0..<testStep1 ).each
{ i=0
tempFile.eachLine
{
testCase.setPropertyValue("inputValue", lines[i++])
inputValue = context.expand( '${#TestCase#inputValue}' )
myTestStep = testCase.getTestStepAt(temp1)
myTestRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(myTestCase,null)
myTestStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(GetFlight)
myTestStep.run( myTestRunner, myTestStepContext )
xHolder = new XmlHolder(testCase.getTestStepAt(temp1).getProperty("Response").getValue())
f = new File( folderName + ‘/’ + inputValue + ‘_’ + testCase.getTestStepAt(temp1).getName().toString() + '.txt')
f.append("\r\n\r\n\r\n\r\n\r\n")
f.append("#################################################\r\n")
f.append("\t\t\t Response \r\n")
f.append("#################################################\r\n\r\n\r\n\r\n\r\n")
f.write(xHolder.prettyXml)
xHolder.clear()
}
temp1++
}
Regards,
- Karthik