ru.yandex.qatools.ashot.coordinates.WebDriverCoordsProvider Maven / Gradle / Ivy
package ru.yandex.qatools.ashot.coordinates;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
/**
* @author Pavel Zorin
*/
public class WebDriverCoordsProvider extends CoordsProvider {
@Override
public Coords ofElement(WebDriver driver, WebElement element) {
Point point = element.getLocation();
Dimension dimension = element.getSize();
return new Coords(
point.getX(),
point.getY(),
dimension.getWidth(),
dimension.getHeight());
}
}