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