Declaring variable at suite level
Comments
-
Variables are declared on the Variables tab in the Test Suite editor. Once delcared, you can get or set a variable's value from a scripted field or Extension tool where you can specify Java method or script. One of the arguments passed to your method is an object of type com.parasoft.api.ScriptingContext. It has methods "getValue(String variableName)" and "setValue(String variableName, String value)".
The docs have some addition detail. See Defining Variables.
0 -
Thanks for your reply. I have set value in my java class like this. etc.setValue("encryPass", encPass);
And declared variable in test suite EncrpyPass = Value = etc.getValue("encryPass")
But still in the request the password value is going like below:
"pwd":"etc.getValue(\"ecrypPassword\")"
Please suggest me solution
0 -
First, is the name of your test suite variable "encryPass" or "EncrpyPass" or "ecrypPassword"? Check for typos. Case matters as well.
Second, make sure the variable is declared prior to being set. The "setValue" method will return false if you tried to set the value of a test suite variable that is not found.
0 -
Hi Benken, Thanks for the reply.
EncrpyPass is the name of the test suite variable.
ecrypPassword is the string variable.Yes the variable is declared prior to set.
But still in the request the password value is going like below:
"pwd":"etc.getValue(\"ecrypPassword\")"
0 -
Thank you this is resolved
0