cancel
Showing results for 
Search instead for 
Did you mean: 

How to recognize CSS menu

mazhar555
Contributor

RE: How to recognize CSS menu

Hello, i cannot give you the project link cuz its not on internet. Hoever you can use the following code which has the same problem.




'Defining Global Veriables



Dim Page, p

Sub browserLaunch()


Call TestedApps.IEXPLORE.Run(-1,false)


Delay(5000)


Set p = Sys.Process("iexplore")


Set page = p.page("*")


End Sub


Sub launchURL(url)


page.toUrl(url)


page.wait End Sub


sub callMenuItem(mMenu,sMenu,cMenu)

dim mobj,sobj,cobj, PropmArray, ValuesmArray


PropmArray = CreateVariantArray(0, 1)


ValuesmArray = CreateVariantArray(0, 1)


PropmArray(0) = "ObjectType"


PropmArray(1) = "innerText"


ValuesmArray(0) = "Link"


ValuesmArray(1) = cMenu


set mobj = page.NativeWebObject.Find("innerText",mMenu)


mobj.HoverMouseset sobj = page.NativeWebObject.Find("innerText",sMenu)


sobj = page.NativeWebObject.Find("innerText",sMenu)

sobj.HoverMouseset cobj = page.Find(PropmArray,ValuesmArray,20)


cobj = page.Find(PropmArray,ValuesmArray,20)

cobj.Click


page.WaitLog.Message("Link Clicked")



'''''*******Following code is also not working in some cases**********

'set cObj = page.NativeWebObject.Find("innerText",cMenu)


'cobj.Click


'page.Wait


'Log.Message("Lick Clicked")



End Sub


sub Main()

call browserLaunch()


Call launchURL("http://www.cricinfo.com")


'working for the following


Call callMenuItem("Features","Regulars","Print Run")


Delay(2000)


'Not Working for the following params


Call callMenuItem("Features","All Time XI","Pakistan")

End Sub



Most intresting thing is change the order of calling menu in Main and see result is totaly different:


sub Main()

call browserLaunch()


Call launchURL("http://www.cricinfo.com")


'working for the following


Call callMenuItem("Features","All Time XI","Pakistan")


Delay(2000)


'Not Working for the following params


Call callMenuItem("Features","Regulars","Print Run")

End Sub


-
Muhammad Mazhar Mahmood
Certified Software Tester (CSTE)
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors