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,330 points
5,175 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
1 answer

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

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
12,646 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
16,981 views
0 votes
2 answers

How to scroll down a webpage in selenium using Java?

This works... JavascriptExecutor jse = (JavascriptExecutor)driver; j ...READ MORE

answered Apr 3, 2019 in Selenium by anonymous
21,636 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
440 views
0 votes
1 answer

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,510 points
3,145 views
0 votes
1 answer
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
2,368 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,890 points
2,517 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
330 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,110 views