Yes, but didn't work as well.. but I tried this and it worked. :)

@engine.link(:href=>'javascript:fnLogin()').send_keys :enter


On Thu, Sep 15, 2011 at 9:38 PM, Super Kevy
<kpe...@scholarshipamerica.org>wrote:

> Did you try the image click?
>
> On Sep 14, 8:21 am, Anne Kristine King <apo...@gmail.com> wrote:
> > Hi Everyone,
> >
> > Need help in figuring out how to click the link below with the given html
> :
> >       <tbody><tr>
> >         <td style="padding-bottom: 8px;" class="loginStyle"
> vAlign="bottom"
> > width="120" align="right">Customer ID:&nbsp;</td>
> >         <td style="padding-bottom: 6px;" width="201">
> >           <label>
> >     <input id="userid" class="loginInput" name="j_username"
> maxLength="32"
> > value="" type="text">
> >   <input id="BrowserName" name="BrowserName" value="IE" type="hidden">
> >          </label>
> >        </td>
> >       </tr>
> >       <tr>
> >         <td style="padding-bottom: 8px;" class="loginStyle"
> vAlign="bottom"
> > align="right">Password:&nbsp;&nbsp;</td>
> >         <td style="padding-bottom: 6px;"><label>
> >           <input id="password" class="loginInput" name="j_password"
> > maxLength="32" value="" type="password">
> >         </label></td>
> >       </tr>
> >       <tr>
> >         <td><a href="javascript:fnLogin()"><img id="Image3"
> > onmouseover="MM_swapImage('Image3','','/Images/login_over-pages.gif',1)"
> > onmouseout="MM_swapImgRestore()" src="/Images/login-pages.gif"
> width="120"
> > height="19"></a></td>
> >       </tr>
> >     </tbody>
> >
> > I'm using watir-webdriver, and I've tried it this way, but it's not
> > successful..
> >
> > irb(main):045:0> @engine.link(:href,
> > /javascript:fnLogin/).fire_event('onmousedown')
> > => true
> > irb(main):046:0> @engine.link(:href,
> > /javascript:fnLogin/).fire_event('onclick')
> > => true
> > irb(main):047:0> @engine.link(:href, /javascript:fnLogin/).click
> > Selenium::WebDriver::Error::ElementNotDisplayedError: Cannot click on
> > element
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/response.rb:45:in
> > `assert_ok'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/response.rb:15:in
> > `initialize'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/http/common.rb:53:in
> > `new'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/http/common.rb:53:in
> > `create_response'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/http/default.rb:56:in
> > `request'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/http/common.rb:34:in
> > `call'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/bridge.rb:410:in
> > `raw_execute'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/bridge.rb:388:in
> > `execute'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/remote/bridge.rb:236:in
> > `clickElement'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.5.0/lib/selenium/w­ebdriver/common/element.rb:34:in
> > `click'
> >         from
> >
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.3/lib/watir-webdriv­er/elements/element.rb:67:in
> > `click'
> >         from (irb):47
> >         from C:/Ruby192/bin/irb:12:in `<main>'
> >
> > Hope somebody can help me with this..
> > Thanks Guys! :)
>
> --
> 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
>

-- 
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

Reply via email to