-1

I have seen this code to go to a specific element.

    WebElement element = driver.findElement(By.xpath("Value"));
    Coordinates coordinate = ((Locatable)element).getCoordinates(); 
    coordinate.onPage(); 
    coordinate.inViewPort();

I'm trying to implement this in my code, but when appears a message in the driver as it shows in the picture. Am I doing something wrong? maybe I have to import a package or create an instance?

I will appreciate your help. enter image description here

INDRAJITH EKANAYAKE
  • 3,894
  • 11
  • 41
  • 63
Fernando.F
  • 65
  • 8

1 Answers1

0

try to do it with JavaScript:

((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(false);", element);

Alex Chumakin
  • 56
  • 1
  • 5