Search code examples
seleniumprotractorappiumui-automationappium-ios

How to perform a scroll in a drop down list to hidden element?


How to perform a scroll in a drop down list with that format with selenium, appium ? I'm using tag name to identify elements, <md-option .../> are the items in the drop down list. enter image description here

Here is my html code :

enter image description here


Solution

  • I have solved it by this way :

    // Create instance of Javascript executor
    JavascriptExecutor je = (JavascriptExecutor) driver;
    //Identify the WebElement which will appear after scrolling down
    WebElement element = driver.findElement(By.tagName("...."));
    // now execute query which actually will scroll until that element is not appeared on page.
    je.executeScript("arguments[0].scrollIntoView(true);",element);