QTP Descriptive Programs Headline Animator

QTP Descriptive Programs

Friday, June 13, 2008

How to Launch QTP with desired Recording Settings for Web Application?

Prerequisites: Open QTP and navigate to Recording and Running setting window, make sure the setting as displays as below.




Procedure: Open notepad and Paste the below Script and save it in appropriate location with .vbs extension (Ex: Test.vbs). Once the script is saved Click on that VBS File (Double Click), it opens QTP Window with specified recording and running settings

Code:
Dim QApp ' Declares a Variable
Set QApp = CreateObject ("QuickTest.Application") 'Creates an Object to Variable
QApp.SetActiveAddins Array ("Web", "ActiveX") ' Activates Web and ActiveX Add-ins While Launching QTP Window
QApp.Launch ' Requesting to Launch QTP Window
QApp.Visible = True ' Makes QTP Window as Visible
QApp.New ' Open a New Test Window

'Configuration of Web Tab in Recording and Running Settings

QApp.Test.Settings.Launchers ("Web").Active = True 'Activates 2nd Option ( Opens the Following Addess when a Record or Run Session begins) in Web Tab in Record and Run Settings
QApp.Test.Settings.Launchers ("Web").Browser = "IE/ FF20" 'Makes Internet Explorer/ FireFox as default Browser for recording and running
QApp.Test.Settings.Launchers("Web").Address = "http://qtpdescriptiveprograms.blogspot.com" ' Provides the specific URL in Addess Bar
QApp.Test.Settings.Launchers("Web").CloseOnExit = True/ False 'Enables/ Disables CheckPoint Close Browser when test closes

Verification: Once the QTP Window is visible open recording and running settings window and check the configuration settings are arranged as per the code in VBS file



No comments: