How to write AOM scripts?
10 Jul 2008 - 05:47:02 pm
You need to understand that the very root of QT AOM is Application Object. Every automation script begins with the creation of the QuickTest "Application" object. Creating this object does not start QuickTest. It simply provides an object from which you can access all other objects, methods and properties of the QuickTest automation object model.You can create only one instance of the Application object. You do not need to recreate the QuickTest Application object even if you start and exit QuickTest several times during your script. Once you have defined this object you can then successfully work and perform operations on other objects given in Quick Test Pro > Documentation > QuickTest Automation Reference.For ex: Let us connect to TD QC using AOM and open a script "qtp_demo"Dim qt_obj 'Define a Quick Test object
qt_obj = CreateObject("Quick Test.Application") ' Instantiate a QT Object. It does not start QTP.
qt_obj.launch ' Launch QT
qt_obj.visible ' Make QT visible
qt_obj.TDConnection.Connect "http://tdserver/tdbin", _ 'Referencing TDConnection Object
"TEST_DOMAIN", "TEST_Project", "Suri", "Testing", False ' Connect to Quality Center
If qt_obj.TDConnection.IsConnected Then ' If connection is successful
    qt_obj.Open "[QualityCenter] Subjecttestsqtp_demo", False ' Open the test
Else
    MsgBox "Cannot connect to Quality Center" ' If connection is not successful, display an error message.
End If
To quickly generate an AOM script with the current QTP settings. Use the Properties tab of the Test Settings dialog box (File > Settings) OR the General tab of the Options dialog box (Tools > Options) OR the Object Identification dialog box (Tools > Object Identification). Each contain a "Generate Script" button. Clicking this button generates a automation script file (.vbs) containing the current settings from the corresponding dialog box. You can run the generated script as is to open QuickTest with the exact configuration of the QuickTest application that generated the script, or you can copy and paste selected lines from the generated files into your own automation script.
Admin · 845 views · 3 comments

Permanent link to full entry

http://automation-qtp.discussionsblog.com/QTP-b1/How-to-write-AOM-scripts-b1-p7.htm

Comments

No comments are allowed in this blog


Leave a comment

No comments are allowed in this blog

Last Comment

Yes, Even I agree. Some of ...

2009-12-22 @ 05:59:03 pm
by siva


I agree, some of the answers ...

2009-11-09 @ 03:59:29 pm
by ashwani


Can anyone tell me how to ...

2009-03-01 @ 12:38:47 pm
by harshada


Hi Can anyone help me out ...

2008-11-20 @ 05:01:49 pm
by Ramesh


some of your answers are wrong....

2008-09-15 @ 03:28:25 pm
by avnish


please post HP0-M80 & HP0-M81 Sample ...

2008-08-22 @ 08:46:36 pm
by Test


Hi dhruv, ...

2008-07-28 @ 08:35:15 am
by suri


Hi all,

This blog is ...

2008-07-28 @ 06:47:17 am
by dhruv


hi experts, this is gud site.. from ...

2008-07-22 @ 11:19:25 pm
by rameshtt


Hi , Here I'm giving a ...

2008-07-17 @ 03:59:04 pm
by lavanya


You can do that by using ...

2008-07-17 @ 09:01:26 am
by suri


How to Highlight the textbox data 'To ...

2008-07-17 @ 08:58:30 am
by suri


Please provide answers to these questions

2008-07-16 @ 03:53:48 pm
by Sreekanth


Hi , ...

2008-07-16 @ 12:50:21 pm
by Admin


We can do the same in ...

2008-07-16 @ 12:34:07 pm
by Admin


Who's Online?

Member: 0
Visitor: 1

Announce

Tags

No tags in this Blog

rss Syndication

Archives