| || |
Seting up environment variables in repository parameter window
How can I set enviornment variables as value for the object in object repository and thus read value in runtime [QTP 11.0 ]
Like in runtime I want the property value of the object should take value from the enviornment variable
For eg :
I have enviornment variable - outhtmlVal ( user defined env variable ) where I am passing the value for the outerhtml property of the object.
How I can set this environment variable for the object from the repository parameter window ( object repository) so that in runtime the env variable value will be read
Appreciate your help because I am also stuck up in finding the setting from qtp.
Last edited by bineesh77; 06-29-2013 at 10:29 AM.
appreciate if anyone can reply as almost stuck up
Are you looking for
Environment.value and Set/GetToProperty logic?
I read your post a few times and do not understand it. Could you provide a little bit of code?
Could just use SetTOProperty to give the relevant property the value of your environment variable.
Thank you all for the valuable suggestion
My code looks like below
Environment.Value("QLValue")="<DIV class=qv-tip cmos_prod="""+Datatable.Value("CatalogId",dtGlobal )+"_"+".*"+Datatable.Value("ItemId",dtGlobal)+"" " product_id="""+".*"+"</DIV>"
Where 'QLvalue' is an enviornment variable.
And when my scripts run , I want my object to read the environment variable value as it's outerhtml property value
the outerhtml property value of my object looks like-
Please let us know you would like to do this manually or through script?
If you want to add the object properties in OR manually, then you can use/parametrize with Env Variables also.
Step 1. First add your env var. File -> Settings -> Env. -> Choose User Defined -> Add your Env var.
Step 2. Open your OR, point to the object and the property, once you click on the Value you will see <#> Click on that.
Step 3. Choose parameter as Environment, in dropdown you will see your env. var.
Let me know if you find any difficulty.
Yaa i tried the same steps .But when I click the value part and tried to map the env variable in the 'repository parameter' pop up, only constant drop down was enabled . The parameter part was disabled .Do I want to set up the same somewhere else also ?
You can use descriptive programming approach