Monday, November 18, 2019

soap ui



soap ui file reading via groovy script

for more please refer

// To get the output value, use the built-in result map object
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath
def directoryName = projectPath + "/testData"
def row = testRunner.testCase.testSteps["DataSource"].currentRow
def allFiles = []
new File( directoryName ).eachFile() { file ->
    if( file.name =~ /.txt/ ) {
        allFiles.add( file.name ) }
}
if ( (row + 1) <= allFiles.size ) {
    // Output to the test step property called inputData
    result["inputData"] = new File( directoryName + "/" + allFiles[row] ).text
}

https://www.soapui.org/scripting-properties/tips-tricks.html

No comments:

Post a Comment

Type Casting in C++

static_cast