My guess would be that the submenu is triggered by the link? Try browser.link(:text => 'Process').click or if you really need xpath try: browser.link(:xpath => "//ul[@class='rmRootGroup rmHorizontal']// a[contains(text(),'Process')]").click
On Feb 10, 5:27 am, Charity <[email protected]> wrote: > Hi All, > > Looking for some help selecting from a dynamically generated > navigation bar that does not have ids and all of the class names are > the same. For example: > > <UL class=rmRootGroup rmHorizontal> > <LI class=rmItem> > <A class=rmLink rmRootLink> > <SPAN class=rmText rmExpandDown> > #text (Project) > <LI class=rmItem> > <A class=rmLink rmRootLink> > <SPAN class=rmText rmExpandDown> > #text (Process) > <LI class=rmItem> > <A class=rmLink rmRootLink> > <SPAN class=rmText rmExpandDown> > #text (Resource) > > What I have tried so far: > > require "watir-webdriver" > browser = Watir::Browser.new :ie > browser.goto "http://Internal-URL/" > > browser.ul(:xpath,"//ul[@class='rmRootGroup rmHorizontal' and > li[contains(.,'Process')]]").click > > What this does is very quickly click all of the navigation buttons in > the row one by one but does not leave any of the sub-menus present. > > Being fairly new to Watir and brand new to XPath I apologize if this > is an obvious answer, but I would really love some help. > > Thanks in advance! > Charity -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
