How to get the environment variable value using jython in soatest?
How to get the environment variable value using jython in soatest?
I need to pass the Env Variables in the service request file with scripted option, How can I pass it?
I have used the following option but get the NONE result.
def getTestCdValue(input,context):
testcd = context.getEnvironmentVariableValue("environmentVariableName");
print 'testcd ID: ' , testcd
Application.showMessage(str(testcd))
return str(testcd)
Answers
-
The "getEnvironmentVariableValue" method does work. Perhaps you have a typo or misspelled the variable name? Or perhaps you have the variable defined in one environment but not the one that's enabled when running the tests?
Assuming you are trying to get the "TESTCD" variable you should be calling
context.getEnvironmentVariableValue("TESTCD")
.0