/** * @param id The value of the "id" attribute to search for * @return a By which locates elements by the value of the "id" attribute. */ public static DeferredBy id(final String id) { return by(By.id(id)); }
@Override public String toString() { return "DeferredBy(" + super.toString() + ")"; } };
/** * Finds elements via the driver's underlying W3 Selector engine. If the browser does not * implement the Selector API an exception will be thrown. */ public static By cssSelector(final String selector) { return by(By.cssSelector(selector)); }
@Override public int hashCode() { return toString().hashCode(); }
/** * @param linkText The text to match against * @return a By which locates A elements that contain the given link text */ public static By partialLinkText(final String linkText) { return by(By.partialLinkText(linkText)); }
/** * @param xpathExpression The xpath to use * @return a By which locates elements via XPath */ public static By xpath(final String xpathExpression) { return by(By.xpath(xpathExpression)); }
/** * @param linkText The exact text to match against * @return a By which locates A elements by the exact text it displays */ public static By linkText(final String linkText) { return by(By.linkText(linkText)); }
/** * @param name The value of the "name" attribute to search for * @return a By which locates elements by the value of the "name" attribute. */ public static By name(final String name) { return by(By.name(name)); }
/** * @param name The element's tagName * @return a By which locates elements by their tag name */ public static By tagName(final String name) { return by(By.tagName(name)); }
/** * Finds elements based on the value of the "class" attribute. If an element has many classes * then this will match against each of them. For example if the value is "one two onone", then the * following "className"s will match: "one" and "two" * * @param className The value of the "class" attribute to search for * @return a By which locates elements by the value of the "class" attribute. */ public static By className(final String className) { return by(By.className(className)); }