In QTP11, I have a function as below to handle a drop-down list button. The HTML structure is as follows:
Sub FindDropdown(text)
' get page and text as parameter
counter = 0
Set oDesc = Description.Create()
oDesc("html tag").Value = "tr"
Set trContent = Browser("Change Management - SAP").Page("Change Management - SAP").ChildObjects(oDesc)
TRSum = trContent.Count()
For i = 0 To TRSum - 1
Set objPage = trContent(i).Object
Set objTag = objPage.GetElementsByTagName("td")
spanSum = objTag.Length - 1
For intCtr = 0 to spanSum
strLink = objTag(intCtr).InnerText
If strLink = text Then
trContent(i).Object.click()
End If
Next
Next
Set oDesc=nothing
End Sub
While I have tested, and the with inner element Select All could be recognized, I could not perform an action (like click), and in fact, the code: trContent(i).Object.click() seems having no effect.
Does this have anything to do with the listener/event handler place? such as the listener is not is the TR or TD element?