[wtr-general] Re: Scroll DIV element in watir-webdriver

2011-09-27 Thread orde
This works in watir 1.9.x:

@browser.div(:id, foo).document.scrollintoview

Hope it helps.

orde

On Sep 27, 8:10 am, the_zonker  wrote:
> Hi guys,
>
> My SUT has a modal popup with dynamically loaded content. When user
> scrolls it down new records appear. DIV element of modal popup, which
> contains all records, has its own scroll bar.
>
> So my task is to scroll down DIV to the bottom, wait until all records
> are loaded and get them all.
> At present moment I cannot scroll down DIV.
>
> I tried to iteratively focus on records to get scrolling in DIV, but
> scrolling didn't happen and thereby no any records are loaded.
>
> Does watir-webdriver has native methods to scroll inside the element
> (not in browser window or frame)?
> I know that there are some solutions which use tricky Javascript but
> I'm trying to avoid it.
>
> I appreciate any help.
>
> Regards, Vadim

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


[wtr-general] Re: Scroll DIV element in watir-webdriver

2011-09-29 Thread the_zonker
Thanks, Jari.

It works.

On Sep 27, 10:35 pm, Jari Bakken  wrote:
> On Tue, Sep 27, 2011 at 5:10 PM, the_zonker  wrote:
>
> > Does watir-webdriver has native methods to scroll inside the element
> > (not in browser window or frame)?
>
> Try this (accessing the underlying WebDriver API):
>
>   element.wd.location_once_scrolled_into_view

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