2

I want to move down panel using selenium webdriver.

           public void AddCode()

           {

             try
             {
                   getChromeDriver().findElementByClassName("odd").click();
        Thread.sleep(5000);

          getChromeDriver().manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);

                       /*I want to move down panel here.

                         Panel tag : <div id="icd9-tab-data">

                         Scrollbar tag : <div class="mCSB_dragger_bar" style="position: relative; line-height: 505px;"></div>*/

        /* "add-ic9-diagnosis-code" link has been displayed in bottom of panel, so not able to click on this link without scrolling panel. */
        getChromeDriver().findElement(By.id("add-icd9-diagnosis-code")).click();
        Thread.sleep(3000);

    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}

I want to move down panel using selenium webdriver.

Panel tag :

Scrollbar tag :

1 Answer 1

1

Do you want something like:

((JavascriptExecutor)driver).executeScript("window.scrollBy(0,10);");

//This code is tested to scroll the browser scrollbar

Or you can use this code to focus (move to) the element:

Actions action = new Actions(driver);
action.moveToElement(WebElement).perform();

If both are not as per your requirement, please elaborate more about your requirement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.