CLA with python scripting
Hi
I am using the Command Line adapter with python scripts. I cannot seem to pass execution variable to this python script. There are examples that state that I need to define the a variable as "$qm_userName" ,
This does not seem to work in a python script. Please advise on how I need to define a variable in a python script so that I can pass execution variables from a Jazz test case level.
Thanks,
Leesen
2 answers
These are passed to the script as environment variables
Something like this should work:
import os
name = os.environ("qm_userName")
etc
Something like this should work:
import os
name = os.environ("qm_userName")
etc
Comments
Well you don't have to have a batch file. If your python script is sophisticated enough you can directly invoke it instead of a wrapper script. Anything you can type as a single command for the command prompt can be a CLA script. I don't know about windows but Unix like operating systems would pass the environment from the invoking shell script to the python script as well. Try it - it is very easy to test - have python print one of your passed variables. If you do it as a CLA script the output will be captured in the stdout file that gets attached to the execution result.