Friday 16 September 2011

QTP - AOM - Working with Environment Variables

Leave a Comment

'Automation Object Model

'****************************************************************** 
'******************************************************************
' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
' What ==>  This is a QTP - AOM Script to Open QTP and to work with Environment Variables
' How ==> Need QuickTest.Application Automation Object to do so
' Why ==> To Open a Driver Script (which could call other tests)
'                                 To work with Environment Variables in QTP
' Author : GAReddy @ OneTestingCenter @QTP
'****************************************************************** 
'***************************************************************** 

Dim oQTP   
Set oQTP = CreateObject("QuickTest.Application") ' Create the Application object 
oQTP.Launch ' Start QuickTest 
oQTP.Visible = True ' Make the QuickTest application visible 

' Open the test 
oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False
' Open a test named Driver Script
 
' Set some environment variables 
oQTP.Test.Environment.Value("AppName") = "AnyWebApp" 
oQTP.Test.Environment.Value("AppVersion") = "3.0" 
oQTP.Test.Environment.Value("TestSuite") = "SmokeTest"
 
oQTP.Test.Save ' Save the test   
oQTP.Quit ' Exit QuickTest 
Set oQTP = Nothing ' Release the Application object 
'*********************************************************** 
'***********************************************************

0 comments:

Post a Comment

Friday 16 September 2011

QTP - AOM - Working with Environment Variables


'Automation Object Model

'****************************************************************** 
'******************************************************************
' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
' What ==>  This is a QTP - AOM Script to Open QTP and to work with Environment Variables
' How ==> Need QuickTest.Application Automation Object to do so
' Why ==> To Open a Driver Script (which could call other tests)
'                                 To work with Environment Variables in QTP
' Author : GAReddy @ OneTestingCenter @QTP
'****************************************************************** 
'***************************************************************** 

Dim oQTP   
Set oQTP = CreateObject("QuickTest.Application") ' Create the Application object 
oQTP.Launch ' Start QuickTest 
oQTP.Visible = True ' Make the QuickTest application visible 

' Open the test 
oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False
' Open a test named Driver Script
 
' Set some environment variables 
oQTP.Test.Environment.Value("AppName") = "AnyWebApp" 
oQTP.Test.Environment.Value("AppVersion") = "3.0" 
oQTP.Test.Environment.Value("TestSuite") = "SmokeTest"
 
oQTP.Test.Save ' Save the test   
oQTP.Quit ' Exit QuickTest 
Set oQTP = Nothing ' Release the Application object 
'*********************************************************** 
'***********************************************************

No comments:

Post a Comment