Moving down and moving left the scroll bar that exists within the webpage

0 votes

I want to move the vertical and horizontal scrollbar that exists within the webpage itself.

 I inspected an element.

<div id="DashboardPageContentDiv" class="DashboardPageContentDiv" style="height: 521px; overflow: auto;">

Method:
public void scrollbardown(RemoteWebDriver remoteWebDriver) throws Exception {

    try 

    {

        JavascriptExecutor jse = (JavascriptExecutor)remoteWebDriver;

        jse.executeScript("window.scrollBy(0,2500)", "");

    } 

   catch (Exception exc)

    {

           }

    }

Frame Source Code:

<iframe allowtransparency="true" id="symbUrlIFrame2" src="/cos/start.swe?SWECmd=GetCachedFrame&amp;SWEC=13&amp;SWEFrame=symbUrlIFrame2&amp;SRN=xaU5eD1S1IOkspAeHu524NMsHC5h5jzSUipwpmEq8bYb " height="800" width="100%" style="height: 607px; position: relative;"></iframe>

May 24, 2018 in Selenium by Martin
• 4,340 points
8,780 views

1 answer to this question.

+1 vote
Best answer

Below code will work: Do find the nearest element and use scroll into view function to move there

JavascriptExecutor js = (JavascriptExecutor) remoteDriver; 

WebElement 

a=remoteDriver.findElement(By.xpath(".//td[@id='titleView!1Subtitle' and 

contains(text(),'Time run: ')]"));

js.executeScript("arguments[0].scrollIntoView();",a );

answered May 24, 2018 by Samarpit
• 5,890 points

selected Dec 30, 2019 by Kalgi
thanks! it worked

Related Questions In Selenium

0 votes
2 answers

How to scroll the Page up or down in Selenium WebDriver? (using java)

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 5, 2020 in Selenium by Sri
• 3,010 points
14,953 views
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
21,958 views
0 votes
5 answers

How to scroll down a webpage in selenium using Java?

 to scroll up or down with Selenium, a JavaScript executor is a ...READ MORE

answered Dec 15, 2020 in Selenium by Roshni
• 10,440 points
33,367 views
0 votes
1 answer

Is it possible to automate the captcha and bar-code reader using Selenium?

Hey Ruhi, it’s not possible to automate ...READ MORE

answered Jun 4, 2019 in Selenium by Umang
881 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
5,085 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,821 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
3,586 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
4,326 views
0 votes
1 answer

Exclude text from `<script>` tag within the HTML DOM when calling `element.getText()`

As you have already identified the WebElement as element next you ...READ MORE

answered May 8, 2018 in Selenium by Samarpit
• 5,890 points
448 views
0 votes
1 answer

Getting different texts from the HTML DOM through Selenium and Python

Try Below code: something = elem.find_element_by_xpath('./td[5]') text1 = driver.execute_script('return ...READ MORE

answered May 14, 2018 in Selenium by Samarpit
• 5,890 points
1,666 views