Unable to read environment variables in extension tool
I have declared some environment variables and trying to read them in the extension tool.
When i am trying to execute throwing the below error.
Error:No Signature of the method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.$() is applicable for argument types.
Below is the code i have used.
import com.parasoft.api,*;
public void usingEnv(){
Application.showMessage(${FileName});
}
FileName i have declared in Environments.
Language which i am using is groovy
Comments
-
I have used scriptingContext.getEnvironmentVariableValue("Name") and it worked.
Can some one tell me how to set the env variable??0 -
The .tst file in the Test Case Explorer view has an Environments node. Add your variable to an environment there.
0 -
I have already added that.
After doing certain validations i want to change the value for that particular environment variable.
for getting the value i have use "getEnvironmentVariableValue" method.
Like wise is there any set method which I can use in my script?0 -
You cannot change the value of an environment variable from a script. If you want a variable whose value you can change from a script, use a Test Variable which is defined in a test suite in the Variables tab. You use the getValue() and setValue() methods to work with a test variable.
0