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

aquality.selenium.core.elements.DesiredState Maven / Gradle / Ivy

Go to download

Library with core functions simplifying work with Selenium-controlled applications.

There is a newer version: 4.2.0
Show newest version
package aquality.selenium.core.elements;

import org.openqa.selenium.WebElement;

import java.util.function.Predicate;

/**
 * Defines desired state for element with ability to handle exceptions.
 *
 * @author lenovo
 * @version $Id: $Id
 */
public class DesiredState {

    private final Predicate desiredStatePredicate;
    private final String stateName;
    private boolean isCatchingTimeoutException;
    private boolean isThrowingNoSuchElementException;

    /**
     * 

Constructor for DesiredState.

* * @param desiredStatePredicate a {@link java.util.function.Predicate} object. * @param stateName a {@link java.lang.String} object. */ public DesiredState(Predicate desiredStatePredicate, String stateName){ this.desiredStatePredicate = desiredStatePredicate; this.stateName = stateName; } /** *

getElementStateCondition.

* * @return a {@link java.util.function.Predicate} object. */ public Predicate getElementStateCondition() { return desiredStatePredicate; } /** *

Getter for the field stateName.

* * @return a {@link java.lang.String} object. */ public String getStateName() { return stateName; } /** *

withCatchingTimeoutException.

* * @return a {@link aquality.selenium.core.elements.DesiredState} object. */ public DesiredState withCatchingTimeoutException(){ this.isCatchingTimeoutException = true; return this; } /** *

withThrowingNoSuchElementException.

* * @return a {@link aquality.selenium.core.elements.DesiredState} object. */ public DesiredState withThrowingNoSuchElementException(){ this.isThrowingNoSuchElementException = true; return this; } /** *

isCatchingInTimeoutException.

* * @return a boolean. */ public boolean isCatchingInTimeoutException() { return isCatchingTimeoutException; } /** *

isThrowingNoSuchElementException.

* * @return a boolean. */ public boolean isThrowingNoSuchElementException() { return isThrowingNoSuchElementException; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy