aquality.selenium.elements.CheckableElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aquality-selenium Show documentation
Show all versions of aquality-selenium Show documentation
Library around Selenium WebDriver
package aquality.selenium.elements;
import aquality.selenium.core.elements.ElementState;
import org.openqa.selenium.By;
public abstract class CheckableElement extends Element {
/**
* The main constructor
*
* @param loc By Locator
* @param nameOf Output in logs
* @param stateOf desired ElementState
*/
protected CheckableElement(By loc, String nameOf, ElementState stateOf) {
super(loc, nameOf, stateOf);
}
public boolean isChecked() {
logElementAction("loc.checkable.get.state");
boolean state = getState();
logElementAction("loc.checkable.state", state);
return state;
}
protected boolean getState() {
return doWithRetry(() -> getElement().isSelected());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy