Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Unable to scroll mouse to an element not visible on the page

    SmartClient Version: v10.0p_2016-09-19/PowerEdition Deployment (built 2016-09-19)
    Browser: Firefox
    Version: 31.8.0

    Background:
    Running automation tests with SmartClientRemoteWebDriver (in isomorphic-webdriver.jar version 5.0) on BrowserStack
    Selenium version: 2.48.2

    After expanding the menu in the Navigation pane (on left side of the page), I am unable to scroll down to an element that is not visible on the page.
    Note: The Navigation pane does not have a scrollbar

    I see there is SmartClientWebDriver().getMouse().mouseDown(Coordinates where) method for scroll action.
    However the method SmartClientWebDriver().findElement(By by).getLocation() returns Point object.
    Is there any method that returns Coordinates object that I can pass in the method on top?

    I tried to use mouseWheel(int i) method available in Robot class (java.awt.Robot.Robot()) but it doesn't seem to work with our (SmartGWT) application.

    #2
    You can call SmartClientWebDriver.mouseMove() on the By locator for the WebElement you need to interact with. That will bring it into view, and then trigger a mouseMove event over the element.

    If that doesn't work, the other option is to call SmartClientWebDriver.getText() on the By locator, for the side effect - it scrolls the targeted element into view before trying to grab the text.

    Note that your FireFox and Selenium version are both fairly old - you may want to update to SC 11.0p so that you can use a newer Selenium JAR and/or FireFox version.

    Comment

    Working...
    X