I use this work-around until scroll_to method is available. I choose
another element, above the one I need to click, and make Watir click it. It
will give me same error for this element too, but the page will scroll up.
At this point I can click the element I need and it will work. In order for
the script not to stop running after getting the error for the first
element, I throw a rescue exception. Here is the code:

        if browsertype == "ff" #I have specified somewhere else an array of
browser types, so here I restrict this only for the browser where error
occurs

            begin

                browser.link(:text, "the above element").click

                rescue Exception => e

            end
        end

              browser.link(:text, "element I need").click


On Fri, Jan 6, 2012 at 7:28 AM, Abe Heward <abe.hew...@gmail.com> wrote:

> Could someone provide advice on how to "monkey patch" watir-webdriver so
> that I can avoid the dreaded 
> *Selenium::WebDriver::Error::MoveTargetOutOfBoundsError:
> Element cannot be scrolled into view:[object HTMLButtonElement]* error?
>
> I don't need all the other overhead of the qa_robusta gem, so help here on
> writing a "scroll_to" method (presumably for the Watir::Element class?)
> would be greatly appreciated!
>
>  I tried to use the qa_robusta method definition as a template, but have
> so far failed to get anything to work.
>
> --
> 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