06-27-2011, 04:02 PM
Well in this case u can bring a concept of .xml file which will be used as common environment variable. Just create "a.xml", initialize the environment variable there in following format---
Now call this environment variable in your function library like following by its name,this will be accessed by all scripts--
Environment.Value("Test123") ---this will return u --"Enter value here" in function library...
Now its the most important part...
Open your test (From which u called that function) in QTP and go to File-->Settings-->Environment Tab-->Select USER DEFINED from drop down-->Check the checkbox "Load Variable......"-->browse that particular xml file. and click ok.
now you are done...now u can access that environment variable from your script through function. Whenever your script will call "Function x" where that environment value is accessed, just load this xml file with that script from which you want to call that function which are accessing that environment variable....
Hope i am clear to u....if there is any doubt, just drop me a mail in souvikghosh.diatm@gmail.com...because i often check these replies...
Code:
<Environment>
<Variable>
<Name>Test123</Name>
<Value>Enter value here</Value>
</Variable>
</Environment>
Now call this environment variable in your function library like following by its name,this will be accessed by all scripts--
Environment.Value("Test123") ---this will return u --"Enter value here" in function library...
Now its the most important part...
Open your test (From which u called that function) in QTP and go to File-->Settings-->Environment Tab-->Select USER DEFINED from drop down-->Check the checkbox "Load Variable......"-->browse that particular xml file. and click ok.
now you are done...now u can access that environment variable from your script through function. Whenever your script will call "Function x" where that environment value is accessed, just load this xml file with that script from which you want to call that function which are accessing that environment variable....
Hope i am clear to u....if there is any doubt, just drop me a mail in souvikghosh.diatm@gmail.com...because i often check these replies...