This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
20 / 24
Apr 2017

Hi Karunakaran, Could you pease share the code to retrieve the last element in the page?

Cheers,
Dev

7 months later

When I login into an iOS App, in the next page, I have to click on a “Next” button in the bottom of that page .
For that I have to scroll down.
I have been trying to use the below code, but it isn’t working for me:

                    Dimension dimensions = driver.manage().window().getSize();
	    Double screenHeightStart = dimensions.getHeight() * 0.5;
	    int scrollStart = screenHeightStart.intValue();
	    System.out.println("s="+scrollStart);
	    Double screenHeightEnd = dimensions.getHeight() * 0.1;
	    int scrollEnd = screenHeightEnd.intValue();
	    for (int i = 0; i < dimensions.getHeight(); i++)
                    {
	    driver.swipe(0,scrollStart,0,scrollEnd,2000);
	    if (driver.findElement(By.id("Next")).isDisplayed()) 
	    	break;
                     }

Please help me with how to tackle this problem. It is scrolling upwards instead of down

26 days later
27 days later