Set oFirstLevel=Browser("FirstLevel").Page("FirstLevel")
MenuSelect "Main
Menu",oFirstLevel.Frame("title:=ScFlex.*"),
20,"File>Masters>Settings>Logon>Applications>Telenet"

Function MenuSelect(ByVal strLogicalName,ByVal oPage,ByVal
inWait,ByVal strMenuPath)
Dim oDict:Set oDict=CreateObject("Scripting.Dictionary")
Dim oRuntimeTable
Dim blFlag:blFlag=False
Dim oTable:Set oTable=Description.Create()
oTable("micclass").Value="WebTable"
oTable("class").Value="clsChildDiv"
oTable("visible").Value=True
Dim arrPath
arrPath=Split(strMenuPath,">")
For i=0 to Ubound(arrPath)
oDict.Add i,arrPath(i)
Next
If oPage.Link("name:="& oDict.Item(0)).Exist(inWait) Then
oPage.Link("name:="& oDict.Item(0)).FireEvent "onmouseover"
wait(2)
For j=1 to oDict.Count-1
Set oRuntimeTable=oPage.ChildObjects(oTable)
wait(1)
oCount=oRuntimeTable.Count-1
If oRuntimeTable(oCount).Object.Style.visibility="visible" Then
rowno=Cint(oRuntimeTable(oCount).GetRowWithCellText(" "&
oDict.Item(j)&" ",1,1))
If rowno>0 Then
oRuntimeTable(oCount).Childitem(rowno,1,"WebElement",0).FireEvent
"onmouseover"
oRuntimeTable(oCount).Childitem(rowno,1,"WebElement",0).Click
wait(1)
End If
Next
Report.WriteReport Util.Counter,"Selected the "&strMenuPath&" path",0
Else
Report.WriteReport Util.Counter,"Unable to select the "&strMenuPath&"
path"&";"&oDict.Item(o)&" menu is not available",1
End If
Set oDict=Nothing
Set oTable=Nothing
Set oRuntimeTable=Nothing
End Function

Happy Tester,
Byzoor,



On Tue, Jul 26, 2011 at 6:30 PM, [email protected] <
[email protected]> wrote:

> Hi,
>
> Can anyone suggest me, how can I give instruction to my QTP to click
> on suboption under a menu item.
> Ex: Menuitem1 > suboption1
>      Menuitem1 > suboption2
>
> Thanks in advance.
>
> -Sreedhar
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to