Monday, 3 March 2014

QTP Automation Object Model

What is AOM file. if we write the aom script in the .vbs file that file is called AOM file How to Create a AOM File: 1. Open the Text file a... thumbnail 1 summary
What is AOM file.
if we write the aom script in the .vbs file that file is called AOM file

How to Create a AOM File:
1. Open the Text file and write the AOM Script
2. Save with extension with .vbs file in required place or folder

How to Run the AOM File:
1. Double Click on the aom file (already created .vbs file with aom script >> it will execute fist QTP and after Driver test : it is QTP Main Test)  )

Assignment 1:
Create the AOM file for the Flight Application for execute the test case and get the results by using Descriptive Programming.
Note: Not use any Tool Options

Solution:
1.  C:\Documents and Settings\Administrator\Desktop\AOM.vbs
Create a folder ProjectFR on Desktop:  
2. C:\Documents and Settings\Administrator\Desktop\ProjectFR\Obj.vbs
3. C:\Documents and Settings\Administrator\Desktop\ProjectFR\Driver\FADriver" 
step 1: Create the AOM File for Launch the QTP, In that execute the Test Case (Launch the FA and execute the Test Case for check the Login Window)

VB Script File Name: AOM.vbs (simply create on desktop)
VB Script File Path: C:\Documents and Settings\Administrator\Desktop\AOM.vbs


Set qtApp=CreateObject("QuickTest.Application")

If Not qtApp.Launched Then 
    qtApp.Launch 
End If

qtApp.Visible = True
qtApp.open "C:\Documents 

and Settings\Administrator\Desktop\ProjectFR\Driver\FADriver"

qtApp.Test.Run
qtApp.Test.Close
qtApp.Quit

Set qtApp  = nothing


Step 2: Write the Descriptive Programming Dynamic for the object properties

VB Script File Name: Obj.vbs
VB Script File Path: C:\Documents and Settings\Administrator\Desktop\ProjectFR\Obj.vbs


Set oLogin =Description.Create
Set  oAgent = Description.Create
Set  oPwd = Description.Create
Set  oOk=Description.Create


oLogin("text").Value = "Login"
oLogin("width").Value=320
oAgent("attached text").Value ="Agent Name:"
oPwd("attached text").Value ="Password:"
oOk("text").Value = "OK"

after create the obj.vbs file, we need to associate to the main test file for identify the objects.
File>> Settings>>Resources>>browse the .vbs file
                          (or) 
executefile c:\obj.vbs   
if u don't like to associate the obj.vbs objects properties file using tools options. 
Use above line vbscript code in the main qtp test file

Step 3: Write the QTP Main Test: That is called Driver Script

QTP File Name:  FADriver (**QTP file save in the form of folder)
QTP File Path: C:\Documents and Settings\Administrator\Desktop\ProjectFR\Driver\FADriver"

Dialog(oLogin).Activate 
Dialog(oLogin).WinEdit(oAgent).Set "abcd"
Dialog(oLogin).WinEdit(oPwd).Set "mercury"
Dialog(oLogin).WinButton(oOk).Click 

Step 4: Double Click on AOM.vbs File which is already available on the desktop.


No comments

Post a Comment