Saturday, July 28, 2012

QTP Environment Variables


Why Environment Variables:

1)We can get the information related to OS(Operating System),test name, testpah & result path
2)We can share the data across the actions like global variables
*********************************************************************************
Environment Variables are two types:
*********************************************************************************
1)Built in 
2) User Defined

*********************************************************************************
Built in :
*********************************************************************************                                    These are the variables which we can't modify at any time


Example: 

To get the test path
msgbox environment.Value("TestDir")


To get the OS name
msgbox Environment.Value("OS")


To get the HostName:
msgbox Environment.Value("LocalHostName")


*********************************************************************************
User defined Env Variables:
*********************************************************************************
      Here user can create the variables depend on the requirement


Again these are two types


1)Internal
2)External


Internal :
     If user is defined the variables with in QTP that variable are called the Internal Variables
External :
     Even User can define the Varibles outside the QTP i.e XML, these variables we can import into QTP called External variables


*********************************************************************************
Note :We can export the Internal variables into XML file
*********************************************************************************















No comments:

Post a Comment