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,220 points
404 views

1 answer to this question.

0 votes

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,130 points

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,050 points
5,738 views
0 votes
2 answers
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 in Selenium by anonymous
937 views
0 votes
1 answer
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,050 points
258 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,130 points
624 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,130 points
250 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,130 points
183 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,130 points
301 views