How To scroll Down In selenium Webdriver

209 views
Skip to first unread message

ritika ritu

unread,
Sep 23, 2014, 4:21:56 AM9/23/14
to seleniu...@googlegroups.com
How to scroll down by mouse in webdriver.

Harish Krishnan

unread,
Sep 23, 2014, 4:28:19 AM9/23/14
to seleniu...@googlegroups.com
Hi,

You can use the below code for mouse scroll.

((JavascriptExecutor)d).executeScript("window.scrollBy(0,1500)")

Regards,
Harikrishnan

On 23 September 2014 13:51, ritika ritu <ritu...@gmail.com> wrote:
How to scroll down by mouse in webdriver.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/51cd4ada-46b5-40f3-8eb6-c234e2423be0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ritika ritu

unread,
Sep 23, 2014, 4:36:35 AM9/23/14
to seleniu...@googlegroups.com
It will work 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/b-KCKU1fj3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Er. Debasish Dutta

unread,
Sep 23, 2014, 4:37:22 AM9/23/14
to seleniu...@googlegroups.com
Hi,
Use below code.

use be

for (int second = 0;; second++) {
            if(second >=60){
                break;
            }
                driver.executeScript("window.scrollBy(0,200)", "");
                Thread.sleep(1000);
            }

On Tue, Sep 23, 2014 at 1:51 PM, ritika ritu <ritu...@gmail.com> wrote:
How to scroll down by mouse in webdriver.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/51cd4ada-46b5-40f3-8eb6-c234e2423be0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Thanks & Regards,

Debasish Dutta

CH!NN@ K

unread,
Sep 23, 2014, 6:26:41 AM9/23/14
to seleniu...@googlegroups.com

Hi all, the above link will help to how to scroll down in a page using selenium webdriver.


For more options, visit https://groups.google.com/d/optout.



--
---
Thanks & Regards,
Purushotham Karimbedu,
Web Developer and QA Engineer,
Media10,
Phone no :9000109120.

ritika ritu

unread,
Sep 24, 2014, 12:50:32 AM9/24/14
to seleniu...@googlegroups.com
thanks all

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/b-KCKU1fj3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Andreas Tolfsen

unread,
Sep 24, 2014, 4:39:18 AM9/24/14
to seleniu...@googlegroups.com
Note that when interacting with a web element, Selenium will scroll to
the element first before interacting with it. There's no need to
explicitly scroll to it.

If scrolling triggers special behaviour on the page, using synthesized
JavaScript events like suggested above is one way. On desktop
browsers one can also use arrow up/down, page up/down, space, &c. to
simulate the same effect since one can't interact with the chrome
scroll bar there.

On mobile the best approach would be to use swipes through the
advanced user actions API. It would useful if someone made a library
on top of that to facilitate easy scrolling.
Reply all
Reply to author
Forward
0 new messages