Showing posts with label Link. Show all posts
Showing posts with label Link. Show all posts

Monday, September 3, 2012

Child Objects Method in QTP


 Child Objects

              This method will display the count of the needed objects that we needed specifically from the application.

For Example:

           1. We might be need the no. of Links (Links)
           2. We might be need the no. of Buttons (WinButton, WebButton)
           3. We might be need the no. of Editbox (WinEdit, WebEdit)  

To display the count of the objects present in the same name we can declare the below syntax.

Example: 1

'Display the count of the links present in the google page:

Set lnk=Description.Create
lnk("micclass").value="Link"
Set brw=Description.Create
brw("name").value="Google"
Set olinks=Browser("name:=Google").Page("title:=Google").ChildObjects(lnk)
msgbox olinks.count

Example: 2

'Display the count of the buttons present in the qtp default flight application landing page:

Set btns=Description.Create
btns("micclass").value="WinButton"
Set dlg=Description.Create
dlg("name").value="Login"
Set ocollection=Dialog("text:=Login").ChildObjects(btns)
msgbox ocollection.count

Example: 3

'Display the count of the Edit Boxes present in the qtp default flight application landing page:

Set btns=Description.Create
btns("micclass").value="WinEdit"
Set dlg=Description.Create
dlg("name").value="Login"
Set ocollection=Dialog("text:=Login").ChildObjects(btns)
msgbox ocollection.count


Wednesday, August 8, 2012

Types of Objects


1. Run Time Object:

        Physical description of an object is called an run time object.
Ex:  (Editor, Button, Link, Checkbox, RadioButton, ComboBox, Window, DialogBox)

2. Test Object:

         This is the reference of Run Time Object used to write the test script based on the application environment,
Ex: (WinEdit, WebButton, VBCheckbox, Swfwindow)

3. Automation Object (or) User defined Object:

           The user can create that can be used across the project, The objects can stored in Repository as like in below format,

        Local Repository --> (.mtr)
        Shared --> (.tsr)