Ask a Question

Is it possible to pass custom properties value to command prompt?

Occasional Contributor

Is it possible to pass custom properties value to command prompt?

1) I have a TestCaseA that store some value :

Name: ID

Value: 10

2) I need one batch file able to pick up the ID that has been store to SOAPUI Custom Properties.

3) Run the batch file


Reason: The batch file will run the TestCaseA multiple times and in the batch file, there will be some action where the command will store file into C and transfer file.


Question: Is it possible groovy script able to do the same?



Occasional Contributor

I finally made a decision to store the value to a file on C:\temp and batch file picks up the value and run the batch based on that ID


project = testRunner.testCase.testSuite.project ;
tcase = project.testSuites["TSuiteName"].testCases["TCaseName"] ;
def idValue

// Get a project property
def projectProperty = tcase.getPropertyValue( "ID" )

def fileName = "test.txt"

// Defining a file handler/pointer to handle the file.
def inputFile = new File("C:\\Temp\\"+fileName)


//this will solve your issue if the folder name has space
//on command prompt, use this command to check
//dir /X ~1 c:\
Process proc=Runtime.getRuntime().exec("cmd /c start c:\\PROGRA~2\\test.bat");

NOTE: for the batch to picks up the value from text, add this to batch file
@Echo OFF

set /p Id=<"C:\\Temp\\test.txt"
echo %Id%
echo "This is ID" %Id%

Showing results for 
Search instead for 
Did you mean: