scrolling in text area

486 views
Skip to first unread message

Automation User

unread,
Sep 10, 2012, 12:25:48 AM9/10/12
to seleniu...@googlegroups.com
Hi

I am working on automating a web page where I have to agree the terms and conditions to click on 'Continue' button. The terms and conditions are displayed in a text area. I need to scroll down the text area and then click the 'Continue' button or else I will receive error message that I should read the terms and conditions.

How can we achieve scrolling in this case? I am working on Java 1.7 with webdriver and testng.

Thanks

Rajat Jindal

unread,
Sep 10, 2012, 1:04:48 AM9/10/12
to seleniu...@googlegroups.com
Hi,

Do you have a webpage available publicly where we can see or simulate this functionality?

Rajat Jindal

unread,
Sep 10, 2012, 1:28:19 AM9/10/12
to seleniu...@googlegroups.com
Hi,

Found this quick solution. It worked for me.

driver.findElementById("abc").click();
    int noOfClicks = 10;
    for(int i = 0 ; i < noOfClicks; i++) {
      driver.findElementById("abc").sendKeys(Keys.ARROW_DOWN); 
    }


Let us know if it works. Incase it dont, providing page as requested in earlier post will be helpful.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/csoE8nj-ROEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Rajat Jindal |  Gurgaon | http://quicksilver1183.com |  rajatj...@gmail.com


Peter Gale

unread,
Sep 10, 2012, 2:30:01 AM9/10/12
to Selenium Users
WebDriver will automatically scroll down for you when you issue the .click() command on your checkbox, even though it is currently off screen.


Date: Sun, 9 Sep 2012 21:25:48 -0700
From: schalas...@gmail.com
To: seleniu...@googlegroups.com
Subject: [selenium-users] scrolling in text area
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/m2Ct4bKrukwJ.

Automation User

unread,
Sep 11, 2012, 7:24:44 AM9/11/12
to seleniu...@googlegroups.com
Thanks Rajat. I used the below logic you provided. I am able to scroll to only a part of the text area and not completely.
This happens with chrome, but with firefox and IE it seem to work.

Thanks for the help!

Rajat Jindal

unread,
Sep 11, 2012, 7:44:18 AM9/11/12
to seleniu...@googlegroups.com
Glad that I am able to help.

Further as you mentioned in chrome you are not able to scroll down completely, I am just wondering if you tried increasing the value of variable noOfClicks? If not please try to increase the value from 10 to something more and see if that helps.

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/2s5QdxZ5Lk8J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages