public class Selectors
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Selectors.ByText |
static class |
Selectors.WithText |
Constructor and Description |
---|
Selectors() |
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.By |
by(java.lang.String attributeName,
java.lang.String attributeValue)
Synonym for #byAttribute
Seems to work incorrectly in HtmlUnit and PhantomJS if attribute name contains dash (e.g.
|
static org.openqa.selenium.By |
byAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Find elements having attribute with given value.
|
static org.openqa.selenium.By |
byClassName(java.lang.String className) |
static org.openqa.selenium.By |
byCssSelector(java.lang.String css) |
static org.openqa.selenium.By |
byId(java.lang.String id) |
static org.openqa.selenium.By |
byLinkText(java.lang.String linkText) |
static org.openqa.selenium.By |
byName(java.lang.String name) |
static org.openqa.selenium.By |
byPartialLinkText(java.lang.String partialLinkText) |
static org.openqa.selenium.By |
byText(java.lang.String elementText)
Find element that has EXACTLY this text
|
static org.openqa.selenium.By |
byTitle(java.lang.String title)
Find element with given title ("title" attribute)
|
static org.openqa.selenium.By |
byValue(java.lang.String value)
Find input element with given value ("value" attribute)
|
static org.openqa.selenium.By |
byXpath(java.lang.String xpath) |
static org.openqa.selenium.By |
withText(java.lang.String elementText)
Find element CONTAINING given text (as a substring)
|
public static org.openqa.selenium.By withText(java.lang.String elementText)
elementText
- Text to search inside elementpublic static org.openqa.selenium.By byText(java.lang.String elementText)
elementText
- Text that searched element should havepublic static org.openqa.selenium.By byAttribute(java.lang.String attributeName, java.lang.String attributeValue)
attributeName
- name of attribute, should not be empty or nullattributeValue
- value of attribute, should not contain both apostrophes and quotespublic static org.openqa.selenium.By by(java.lang.String attributeName, java.lang.String attributeValue)
public static org.openqa.selenium.By byTitle(java.lang.String title)
public static org.openqa.selenium.By byValue(java.lang.String value)
public static org.openqa.selenium.By byName(java.lang.String name)
By.name(java.lang.String)
public static org.openqa.selenium.By byXpath(java.lang.String xpath)
By.xpath(java.lang.String)
public static org.openqa.selenium.By byLinkText(java.lang.String linkText)
By.linkText(java.lang.String)
public static org.openqa.selenium.By byPartialLinkText(java.lang.String partialLinkText)
By.partialLinkText(java.lang.String)
public static org.openqa.selenium.By byId(java.lang.String id)
By.id(java.lang.String)
public static org.openqa.selenium.By byCssSelector(java.lang.String css)
By.cssSelector(java.lang.String)
public static org.openqa.selenium.By byClassName(java.lang.String className)
By.className(java.lang.String)