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

nl.hsac.fitnesse.fixture.util.selenium.by.ValueOfBy Maven / Gradle / Ivy

There is a newer version: 5.3.17
Show newest version
package nl.hsac.fitnesse.fixture.util.selenium.by;

import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;

/**
 * By to get the element to obtain value from.
 */
public class ValueOfBy extends BestMatchBy {
    public ValueOfBy(By nestedBy) {
        super(nestedBy);
    }

    @Override
    public WebElement findElement(SearchContext context) {
        WebElement element = super.findElement(context);
        if (element != null) {
            WebElement nested = ConstantBy.nestedElementForValue().findElement(element);
            if (nested != null && nested.isDisplayed()) {
                element = nested;
            }
        }
        return element;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy