GETTING CHILD OBJECTS AND PERFORMING OPERATIONS




‘**********************************************************************************************************************************
'GETTING CHILD OBJECTS AND PERFORMING OPERATIONS
‘Let us assume, QuickTest is unable perform click operation on particular link in a specific page. Resolution is like getting all the child objects of type Link and can click with VB Scripting.
‘**********************************************************************************************************************************


Public Function funcClickOnLink()

‘Creating Description Object with common properties of links
Set objDescLink = Description.Create()
objDescLink ("micclass").Value = "Link"
objDescLink ("html tag").value="A"

‘Capturing all the child links from the page
Set objLinks = Browser("title := Gmail: Email from Google").Page("title:=Gmail:   Email from Google").ChildObjects(objDescLink)

‘Getting the Link Count
intLinkCount = objLinks.Count

‘Repeating the loop intLinkCount of times
For i = 0 to intLinkCount

‘Getting the InnerText of every link
strLinkText = objLink(i).getroproperty("innertext")

‘If found required link, click and exit for
If strLinkText = "About Gmail" Then

                                    objLinks (i).Click
                                    Exit For

End If

Next

End Function

‘**********************************************************************************************************************************

2 comments:

  1. Please send the QTP material

    Am new to QTP

    Am planning to learn qtp

    How to prepare pls give the guidence

    ReplyDelete
  2. Hi,

    Thanks for you your interest. Please call me on this number 9620075089, we can discuss on this,

    Thanks,
    Bala

    ReplyDelete