public class UiSelectors extends Object
$(withText("Create Invoice")).shouldBe(visible, enabled);
$$(byTagName("A")).shouldHaveSize(5);
$(byXpath("//html/body/div[5]")).doubleClick();
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.By |
by(String attributeName,
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(String attributeName,
String attributeValue)
Find elements having attribute with given value.
|
static org.openqa.selenium.By |
byClassName(String className) |
static org.openqa.selenium.By |
byCssSelector(String css) |
static org.openqa.selenium.By |
byId(String id) |
static org.openqa.selenium.By |
byImage(String imageUrl)
Finds the first image element matching given URL.
|
static org.openqa.selenium.By |
byImage(String imageUrl,
int offsetX,
int offsetY)
Finds the first image element matching given URL.
|
static org.openqa.selenium.By |
byLinkText(String linkText) |
static org.openqa.selenium.By |
byName(String name) |
static org.openqa.selenium.By |
byPartialLinkText(String partialLinkText) |
static org.openqa.selenium.By |
byTagName(String name) |
static org.openqa.selenium.By |
byText(String elementText)
Find element that has EXACTLY this text
NB! It seems that Selenium WebDriver does not support i18n characters in XPath :(
|
static org.openqa.selenium.By |
byTitle(String title)
Find element with given title ("title" attribute)
|
static org.openqa.selenium.By |
byValue(String value)
Find input element with given value ("value" attribute)
|
static org.openqa.selenium.By |
byXpath(String xpath) |
static org.openqa.selenium.By |
withText(String elementText)
Find element CONTAINING given text (as a substring)
NB! It seems that Selenium WebDriver does not support i18n characters in XPath :(
|
public static org.openqa.selenium.By withText(String elementText)
elementText
- Text to search inside elementpublic static org.openqa.selenium.By byText(String elementText)
elementText
- Text that searched element should havepublic static org.openqa.selenium.By byImage(String imageUrl)
imageUrl
- image URLpublic static org.openqa.selenium.By byImage(String imageUrl, int offsetX, int offsetY)
imageUrl
- image URLoffsetX
- horizontal offset from the center of the imageoffsetY
- vertical offset from the center of the imagepublic static org.openqa.selenium.By byAttribute(String attributeName, String attributeValue)
<option data-mailServerId="123"></option>
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(String attributeName, String attributeValue)
public static org.openqa.selenium.By byTitle(String title)
public static org.openqa.selenium.By byValue(String value)
public static org.openqa.selenium.By byName(String name)
By.name(java.lang.String)
public static org.openqa.selenium.By byTagName(String name)
By.tagName(java.lang.String)
public static org.openqa.selenium.By byXpath(String xpath)
By.xpath(java.lang.String)
public static org.openqa.selenium.By byLinkText(String linkText)
By.linkText(java.lang.String)
public static org.openqa.selenium.By byPartialLinkText(String partialLinkText)
By.partialLinkText(java.lang.String)
public static org.openqa.selenium.By byId(String id)
By.id(java.lang.String)
public static org.openqa.selenium.By byCssSelector(String css)
By.cssSelector(java.lang.String)
public static org.openqa.selenium.By byClassName(String className)
By.className(java.lang.String)
Copyright 2016, WorkFusion, Inc.