Hi Hari, Have your tried
ff.link(:id, 'cwc_menu_local:ROOT.Find a Request-anchor').exist? and ff.link(:id, 'cwc_menu_local:ROOT.Find a Request-anchor').click and ff.link(:id, 'cwc_menu_local:ROOT.Find a Request-anchor').fire_event("onlclick") Thanks Ravi P On Wed, Sep 7, 2011 at 11:19 AM, Hari <harisankarec...@gmail.com> wrote: > I'm trying toclick a link the <a>anchor tags from > the html shown below. > I'm running firewatir on Windows Xp and have the > jssh plugin installed. > > > <li onkeydown="return webFXTreeHandler.keydown(this, event)" > class="navTreeLeaf" id="cwc_menu_local:ROOT.Find a Request" > onclick="webFXTreeHandler.toggleDIV(this);"> > <a onblur="webFXTreeHandler.blur(this);" > onfocus="webFXTreeHandler.focus(this);" > id="cwc_menu_local:ROOT.Find a Request-anchor" > onclick="var stat=webFXTreeHandler.select(this); > if(!stat)return stat;;" > ondblclick="webFXTreeHandler.selectOpen(this); > " target="detail" href="/smweb/cwc/nav.menu?name=navStart&id=ROOT > %2FFind%20a%20Request"> > <span class="cwc_navMenuLabel">Find a Request</span></a></li> > > my code is as below and click the link > > ff.link(:text, 'Find a Request').click > > ff.link(:xpath, 'html/body/div[2]/ul/li').click > > ff.link(:xpath, 'html/body/div[2]/ul/li[4]/a[1]/span').click > > ff.link(:xpath, "//a[@id="cwc_menu_local:ROOT.Find a > Request"]/").click > > however the output of the text fails with the error: > > Unable to locate element, using :xpath, "//a[@id=\\\"cwc_menu > _local:ROOT.Find a Request\\\"]/ > input" (Watir::Exception::UnknownObjectException > ) > from C:/Ruby187/lib/ruby/gems/1.8/gems/firewatir-1.9.3/lib/ > firewatir/ > element.rb:1081:in `click' > > tell me were i have to make correction so that i can click a link > > id="cwc_menu_local:ROOT.Find a Request-anchor" > onclick="var stat=webFXTreeHandler.select(this); > > tell me to write a ruby script by using this HTML tag > > Xpath i got using fire bug is > ff.link(:xpath, 'html/body/div[2]/ul/li[4]/a[1]/span').click > > Anyone know where i've gone wrong , please correct me to rectify the > error soon > > Thanks in advance > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com> > -- Regards, P.Raveendran http://raveendran.wordpress.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com