09-20-2012, 11:16 AM
Hi ,
Below is my script and I want to get the all submenus names under top drop down menu on site http://divinevines.ca/. Please find the screenshot to understand the scenario.
Below is my script and I want to get the all submenus names under top drop down menu on site http://divinevines.ca/. Please find the screenshot to understand the scenario.
Code:
Systemutil.CloseProcessByName "iexplore.exe"
Systemutil.Run "iexplore.exe","http://divinevines.ca/"
wait (3)
'a=Browser("Vancouver Flower Shop").Page("Vancouver Flower Shop").WebElement("fall flowers fresh arrangement").GetROProperty("
innertext")
Set omenu=Browser("Vancouver Flower Shop").Page("Vancouver Flower Shop").Object
Set m=omenu.getelementsbyclassname("down")
msgbox "Total top menus are :"& m.length
' To count the submenus of 2nd menu as 1st has not submenus
For i=1 to m.length
msgbox m(i).innertext
zinnertext=m(i).innertext
Set desc=Description.Create
desc("micclass").value="Link"
Browser("Vancouver Flower Shop").Page("Vancouver Flower Shop").WebElement("innertext:="&zinnertext,"html tag:=SPAN").FireEvent "onmouseover"
set submenucount= Browser("Vancouver Flower Shop").Page("Vancouver Flower Shop").WebElement("innertext:="&zinnertext,"html tag:=UL").childobjects(desc)
msgbox "submenu count is "& submenucount.count