nl.hsac.fitnesse.fixture.util.selenium.by.ToClickBy 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;
/**
* Finds elements to click.
*/
public class ToClickBy {
public static By heuristic(String place) {
return new Heuristic(place);
}
public static class Heuristic extends HeuristicBy {
public Heuristic(String place) {
super(LinkBy.exactText(place),
new XPathBy(".//button[descendant-or-self::text()[normalized(.)='%s']]", place),
new XPathBy(".//label[descendant-or-self::text()[normalized(.)='%s']]", place),
new XPathBy(".//summary[descendant-or-self::text()[normalized(.)='%s']]", place),
ElementBy.exact(place),
ConstantBy.submitOrReset(place),
LinkBy.partialText(place),
new XPathBy(".//button[descendant-or-self::text()[contains(normalized(.), '%s')]]", place),
new XPathBy(".//label[descendant-or-self::text()[contains(normalized(.), '%s')]]", place),
new XPathBy(".//summary[descendant-or-self::text()[contains(normalized(.), '%s')]]", place),
ElementBy.partial(place),
new XPathBy(".//text()[@onclick and normalized(.)='%s']/..", place),
new XPathBy(".//text()[@onclick and contains(normalized(.),'%s')]/..", place),
TextBy.exact(place),
TextBy.partial(place));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy