Package com.workfusion.rpa.helpers
Class UiSelectors
java.lang.Object
com.workfusion.rpa.helpers.UiSelectors
This class adds static methods for quick simplified creation of RPA selectors.
- Samples
$(withText("Create Invoice")).shouldBe(visible, enabled);$$(byTagName("A")).shouldHaveSize(5);$(byXpath("//html/body/div[5]")).doubleClick();
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.openqa.selenium.BySynonym for #byAttribute Seems to work incorrectly in HtmlUnit and PhantomJS if attribute name contains dash (e.g.static org.openqa.selenium.BybyAttribute(String attributeName, String attributeValue) Find elements having attribute with given value.static org.openqa.selenium.BybyClassName(String className) static org.openqa.selenium.BybyCssSelector(String css) static org.openqa.selenium.Bystatic org.openqa.selenium.ByFinds the first image element matching given URL.static org.openqa.selenium.ByFinds the first image element matching given URL.static org.openqa.selenium.BybyLinkText(String linkText) static org.openqa.selenium.Bystatic org.openqa.selenium.BybyPartialLinkText(String partialLinkText) static org.openqa.selenium.Bystatic org.openqa.selenium.ByFind element that has EXACTLY this text NB!static org.openqa.selenium.ByFind element with given title ("title" attribute)static org.openqa.selenium.ByFind input element with given value ("value" attribute)static org.openqa.selenium.Bystatic org.openqa.selenium.ByFind element CONTAINING given text (as a substring) NB!
-
Method Details
-
withText
Find element CONTAINING given text (as a substring) NB! It seems that Selenium WebDriver does not support i18n characters in XPath :(- Parameters:
elementText- Text to search inside element- Returns:
- standard selenium By criteria`
-
byText
Find element that has EXACTLY this text NB! It seems that Selenium WebDriver does not support i18n characters in XPath :(- Parameters:
elementText- Text that searched element should have- Returns:
- standard selenium By criteria
-
byImage
Finds the first image element matching given URL. All the actions that rely on image location will use image center coordinates.- Parameters:
imageUrl- image URL- Returns:
- image-based criteria
-
byImage
Finds the first image element matching given URL. All the actions that rely on image location will be corrected according to provided offsets. Offsets are calculated from the center of the image.- Parameters:
imageUrl- image URLoffsetX- horizontal offset from the center of the imageoffsetY- vertical offset from the center of the image- Returns:
- image-based criteria
-
byAttribute
Find elements having attribute with given value. Seems to work incorrectly if attribute name contains dash, for example:<option data-mailServerId="123"></option>- Parameters:
attributeName- name of attribute, should not be empty or nullattributeValue- value of attribute, should not contain both apostrophes and quotes- Returns:
- standard selenium By criteria
-
by
Synonym for #byAttribute Seems to work incorrectly in HtmlUnit and PhantomJS if attribute name contains dash (e.g. "data-mailServerId") -
byTitle
Find element with given title ("title" attribute) -
byValue
Find input element with given value ("value" attribute) -
byName
- See Also:
-
byTagName
- See Also:
-
byXpath
- See Also:
-
byLinkText
- See Also:
-
byPartialLinkText
- See Also:
-
byId
- See Also:
-
byCssSelector
- See Also:
-
byClassName
- See Also:
-