following QA-1254 , util.readOutput(java.lang.String, java.io.File) does not execute in the working directory specified by the java.io.File parameter. It always executes in the "bin" installation path.
One more question -
Do you know any other way (not util.readOutput ) to set variable with return script value? Do you have wxamples for util.readOutput ?
Thanks,
Shani
Description
following QA-1254 , util.readOutput(java.lang.String, java.io.File) does not execute in the working directory specified by the java.io.File parameter. It always executes in the "bin" installation path.
One more question -
Do you know any other way (not util.readOutput ) to set variable with return script value? Do you have wxamples for util.readOutput ?
Thanks,
Shani
I verified this to be working in QB5. To set variable value to output of some command:
groovy:
def workingDir = new File(configuration.workspaceDir, "some sub dir")
vars.get("someVar").setValue(util.readOutput("some command", workingDir))
Or you may do without using util.readOutput like below:
Robin Shen[11/Apr/13 12:48 AM]
I verified this to be working in QB5. To set variable value to output of some command:
groovy:
def workingDir = new File(configuration.workspaceDir, "some sub dir")
vars.get("someVar").setValue(util.readOutput("some command", workingDir))
Or you may do without using util.readOutput like below:
groovy:
vars.get("someVar").setValue("some command".execute().text)
groovy:
def workingDir = new File(configuration.workspaceDir, "some sub dir")
vars.get("someVar").setValue(util.readOutput("some command", workingDir))
Or you may do without using util.readOutput like below:
groovy:
vars.get("someVar").setValue("some command".execute().text)