Interface Coordinates


public interface Coordinates
Provides coordinates of an element for advanced interactions. Note that some coordinates (such as screen coordinates) are evaluated lazily since the element may have to be scrolled into view.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Gets coordinates on the element relative to the top-left corner of OS-window being used to display the content.
    Gets coordinates on the element relative to the top-left corner of the page.
    Gets coordinates on the element relative to the top-left corner of the monitor (screen).
  • Method Details

    • onScreen

      Point onScreen()
      Gets coordinates on the element relative to the top-left corner of the monitor (screen). This method automatically scrolls the page and/or frames to make element visible in viewport before calculating its coordinates.
      Returns:
      coordinates on the element relative to the top-left corner of the monitor (screen).
      Throws:
      ElementNotInteractableException - if the element can't be scrolled into view.
    • inViewPort

      Point inViewPort()
      Gets coordinates on the element relative to the top-left corner of OS-window being used to display the content. Usually it is the browser window's viewport. This method automatically scrolls the page and/or frames to make element visible in viewport before calculating its coordinates.
      Returns:
      coordinates on the element relative to the top-left corner of the browser window's viewport.
      Throws:
      ElementNotInteractableException - if the element can't be scrolled into view.
    • onPage

      Point onPage()
      Gets coordinates on the element relative to the top-left corner of the page.
      Returns:
      coordinates on the element relative to the top-left corner of the page.
    • getAuxiliary

      Object getAuxiliary()