Discussion:
[selenium-users] scroll down to bottom of the page using webdriver
Sunitha S
2017-02-28 19:42:05 UTC
Permalink
Hello,

Im phasing problem with the scroll down.I have used these

1).JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("scrollBy(0,3500)");

2).WebDriverWait wait1 = new WebDriverWait(driver, 30);
WebElement el =
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(text(),'Clinical
Quality Measure Group Performance')]")));
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].scrollIntoView(true);", el);

can you please anyone help me on this issue.
--
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-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/112f7ae7-cfd7-4617-a857-da3f35c529f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Moises Siles
2017-03-01 13:26:16 UTC
Permalink
I think you can try and edit the following method

Locatable scrollToItem = (Locatable) wElement;
int y = scrollToItem.getCoordinates().inViewPort().getY();
y = y - 100;
((JavascriptExecutor)
getWebDriver()).executeScript("window.scrollBy(0," + y + ");");
Post by Sunitha S
Hello,
Im phasing problem with the scroll down.I have used these
1).JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("scrollBy(0,3500)");
2).WebDriverWait wait1 = new WebDriverWait(driver, 30);
WebElement el = wait1.until(ExpectedConditions.
visibilityOfElementLocated(By.xpath("//*[contains(text(),'Clinical
Quality Measure Group Performance')]")));
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].scrollIntoView(true);", el);
can you please anyone help me on this issue.
--
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
To view this discussion on the web visit https://groups.google.com/d/
msgid/selenium-users/112f7ae7-cfd7-4617-a857-da3f35c529f8%
40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/112f7ae7-cfd7-4617-a857-da3f35c529f8%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAN2b6KLe4m%3DiSP6zzG69DK0bGBRDb8NLKpQyPJdNJ%3DbckgMPYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
eddieB
2017-03-01 22:41:58 UTC
Permalink
try this

executeScript("var a = document.getElementById('your id');a.scrollTop =
10000");
Post by Sunitha S
Hello,
Im phasing problem with the scroll down.I have used these
1).JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("scrollBy(0,3500)");
2).WebDriverWait wait1 = new WebDriverWait(driver, 30);
WebElement el =
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(text(),'Clinical
Quality Measure Group Performance')]")));
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].scrollIntoView(true);", el);
can you please anyone help me on this issue.
--
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-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3fc3d729-6b30-48c9-bc62-39d7d93282b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...