diff --git a/java/client/test/org/openqa/selenium/interactions/touch/TouchDoubleTapTest.java b/java/client/test/org/openqa/selenium/interactions/touch/TouchDoubleTapTest.java index b7cc55733e9c6..79f06130b8101 100644 --- a/java/client/test/org/openqa/selenium/interactions/touch/TouchDoubleTapTest.java +++ b/java/client/test/org/openqa/selenium/interactions/touch/TouchDoubleTapTest.java @@ -23,6 +23,7 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Action; +import org.openqa.selenium.internal.Locatable; /** * Tests the basic double tap operations. @@ -44,14 +45,13 @@ public void testCanDoubleTapOnAnImageAndAlterLocationOfElementsInScreen() { driver.get(pages.longContentPage); WebElement image = driver.findElement(By.id("imagestart")); - int y = image.getLocation().y; + int y = ((Locatable) image).getCoordinates().inViewPort().y; // The element is located at a certain point, after double tapping, // the y coordinate must change. assertTrue(y > 100); doubleTapOnElement("imagestart"); - - y = image.getLocation().y; + y = ((Locatable) image).getCoordinates().inViewPort().y; assertTrue(y < 50); }