Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want to Automate clicking on Menu items
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
It's been my experience that the only reliable way to get DP to work with multiple criteria is to use a Description object array.

Code:
dim objdescription, myobj, linkarray
   set objdescription = Description.Create()
   objdescription("text").value = "Click Me"
   objdescription("html tag").value = "a"
   objdescription("html tag").RegularExpression = false
   objdescription("micclass").value = "Link"
   Set myobj = Browser("Browser").Page("Page")
   myobj.sync
   set linkarray = myobj.ChildObjects(objdescription)
   linkarray(0).Click

This should get you started. You can make it dynamic by passing in text and tag parameters. If there is more than one you can add other values to the array such as html id. I took this code a made a click function that will take my ID or Text parameter and search for any clickable object (link, button, image, etc) by changing the micclass if my linkarray object length is "0". You can also use regular expressions.
Reply


Messages In This Thread
RE: Want to Automate clicking on Menu items - by jsknight1969 - 09-02-2010, 10:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to fetch items from WpfList in UFT saurabhkumar_gupta 0 2,286 03-08-2015, 09:17 PM
Last Post: saurabhkumar_gupta
  Can't locate items on Win7 Desktop RandomGrin 0 1,981 01-30-2015, 10:55 PM
Last Post: RandomGrin
  QTP not clicking on the flex button sudheerch 2 3,442 12-03-2013, 12:56 PM
Last Post: sudheerch
  Clicking command button in accesss form mark_cielos24@yahoo.com 1 3,186 05-07-2013, 10:52 PM
Last Post: agarwl.anurag
  Problem in selecting multiple items in the weblist vijay44 7 17,535 08-10-2011, 06:22 PM
Last Post: gaveyom

Forum Jump:


Users browsing this thread: 1 Guest(s)