Micro Focus QTP (UFT) Forums
Accessing Envoirnment Variable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Accessing Envoirnment Variable (/Thread-Accessing-Envoirnment-Variable)



Accessing Envoirnment Variable - ramesh.tahiliani - 12-15-2008

Hi,
1. I created a Insert Output value for an object's Text property
2. Directing this output to a User deifned Envoirnment variable (say "Test")
3. Now I want use this "Test" variable in my program like

Code:
do
<statements>
loop while <Test ="Something">

Here I dont know that how to acees the user defined env var "Test" Value

I tried :
Code:
Envoirnment.value("Test") = "something"    -> Didnt Work
           "Test" = "somehting"                              -> Didnt Work

Could ypu please tell me how can accomplish this task ?

Thanks
Ramesh


RE: Accessing Envoirnment Variable - Ankur - 12-15-2008

Code:
var = Environment.value("Test")



RE: Accessing Envoirnment Variable - ramesh.tahiliani - 12-16-2008

Thanks for reply
I tried the same but it gives me "Type mismatch" Error
I declared var as : dim var


RE: Accessing Envoirnment Variable - Prasanth Chowdary - 12-16-2008

Please find the below example.

Code:
Environment.Value("a") = "aadc"
MsgBox Environment.Value("a")
var = Environment.Value("a")
MsgBox var



RE: Accessing Envoirnment Variable - ramesh.tahiliani - 12-16-2008

hi Prasanth,

Hi,
I have basically created a Insert Output value for an object's Text property and Directed this output to a User deifned Envoirnment variable (say "Test"). Now I want use this "Test" variable in my program like

when i try ; var = Environment.Value("a") then i get type mismatch error.

Thanks
Ramesh


RE: Accessing Envoirnment Variable - ramesh.tahiliani - 12-17-2008

Hi all,

It worked fine with your suggeted code.
I dont know why it was giving the problem at the first time while i was trying the smae code.

Thanks All