All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.applitools.eyes.selenium.fluent.IgnoreRegionBySelector Maven / Gradle / Ivy

There is a newer version: 3.36
Show newest version
package com.applitools.eyes.selenium.fluent;

import com.applitools.eyes.EyesBase;
import com.applitools.eyes.Region;
import com.applitools.eyes.fluent.GetRegion;
import com.applitools.eyes.selenium.Eyes;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class IgnoreRegionBySelector implements GetRegion {
    private By selector;

    public IgnoreRegionBySelector(By selector) {
        this.selector = selector;
    }

    @Override
    public Region getRegion(EyesBase eyesBase) {
        WebElement element = ((Eyes)eyesBase).getDriver().findElement(this.selector);
        return new Region(
                element.getLocation().getX(),
                element.getLocation().getY(),
                element.getSize().getWidth(),
                element.getSize().getHeight());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy