nl.hsac.fitnesse.fixture.util.selenium.by.ValueOfBy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-fixtures Show documentation
Show all versions of hsac-fitnesse-fixtures Show documentation
Fixtures to assist in testing via FitNesse
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