nl.hsac.fitnesse.fixture.util.selenium.by.OptionBy 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;
/**
* By to find option for select element.
*/
public class OptionBy extends HeuristicBy {
private final String text;
public OptionBy(String optionValue) {
super("".equals(optionValue) ? ConstantBy.getEmptyOptionBy() : ConstantBy.nothing(),
new XPathBy(".//option/text()[normalized(.) = '%s']/..", optionValue),
"".equals(optionValue) ? ConstantBy.nothing() : new XPathBy(".//option/text()[contains(normalized(.), '%s')]/..", optionValue));
text = optionValue;
}
@Override
public String toString() {
return super.toString() + ":" + text;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy