Package co.verisoft.fw.utils.locators
Class ElementBy
java.lang.Object
co.verisoft.fw.utils.locators.ElementBy
A set of static methods to extend the search mechanism.
It is used to simplify commonly used FindBy
.
For example:
WebElement myElement = driver.findElement(ElementBy.partialText("searchText"));
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.openqa.selenium.By
partialText
(String text) Finds an element by using any part of it's tag value.
-
Method Details
-
partialText
Finds an element by using any part of it's tag value. For example -<tagName>value</tagName>
can be discovered by "value" or "val" using the following code:
List<WebElement> myList = driver.findElements(ElementBy.partialText("val"));
- Parameters:
text
- the string to be searched- Returns:
- a By object with the string to be searched, ready to be sent to findElement or findElements
-