public class WebUiCommonHelper extends KeywordHelper
Modifiers | Name | Description |
---|---|---|
static String |
CSS_LOCATOR_PROPERTY_NAME |
|
static String |
WEB_ELEMENT_ATTRIBUTE_LINK_TEXT |
|
static String |
WEB_ELEMENT_ATTRIBUTE_TEXT |
|
static String |
WEB_ELEMENT_TAG |
|
static String |
WEB_ELEMENT_XPATH |
|
static String |
XPATH_LOCATOR_PROPERTY_NAME |
Type Params | Return Type | Name and description |
---|---|---|
|
public static By |
buildLocator(TestObject testObject) |
|
public static By |
buildLocator(TestObject testObject, SelectorMethod locatorMethod) |
|
public static By |
buildUnionXpath(TestObject to) Build a locator to find all elements satisfying at least one condition (regardless it is active or not) |
|
public static void |
checkSelectIndex(Integer[] indexes, Select select) |
|
public static boolean |
closeWindowUsingIndex(WebDriver webDriver, int index) |
|
public static boolean |
closeWindowUsingTitle(WebDriver webDriver, String title) |
|
public static boolean |
closeWindowUsingUrl(WebDriver webDriver, String url) |
|
public static String |
findActiveEqualsObjectProperty(TestObject to, String propertyName) |
|
public static WebElement |
findWebElement(TestObject testObject, int timeOut) If the TestObject has a cached WebElement then return this object, otherwise retrieve WebElement from TestObject's properties. |
|
public static List<WebElement> |
findWebElements(TestObject testObject, int timeout) |
|
public static void |
focusOnBrowser() |
|
public static String |
getBrowserAndVersion(WebDriver webDriver) |
|
public static double |
getDevicePixelRatio(WebDriver driver) |
|
public static Rectangle |
getElementRect(WebDriver webDriver, WebElement element) |
|
public static int |
getNumberOfNotSelectedOptionByIndex(Select select, Integer[] indexes, String objectId) |
|
public static int |
getNumberOfNotSelectedOptionByLabel(Select select, String label, boolean isRegex, String objectId) |
|
public static int |
getNumberOfNotSelectedOptionByValue(Select select, String value, boolean isRegex, String objectId) |
|
public static int |
getNumberOfOptionByLabel(Select select, String label, boolean isRegex, String objectId) |
|
public static int |
getNumberOfOptionByValue(Select select, String value, boolean isRegex, String objectId) |
|
public static int |
getNumberOfSelectedOptionByIndex(Select select, Integer[] indexes, String objectId) |
|
public static int |
getNumberOfSelectedOptionByLabel(Select select, String label, boolean isRegex, String objectId) |
|
public static int |
getNumberOfSelectedOptionByValue(Select select, String value, boolean isRegex, String objectId) |
|
public static String |
getSelectorValue(TestObject testObject) |
|
public static String |
getSelectorValue(TestObject to, SelectorMethod selectorMethod) |
|
public static int |
getViewportHeight(WebDriver webDriver) |
|
public static int |
getViewportWidth(WebDriver webDriver) |
|
public static boolean |
isElementVisibleInViewport(WebDriver driver, TestObject testObject, int timeOut) |
|
public static boolean |
isElementVisibleInViewport(WebDriver driver, WebElement element) |
|
public static boolean |
isTextPresent(WebDriver webDriver, String text, boolean isRegex) |
|
public static String |
saveWebElementScreenshot(WebDriver driver, WebElement element, String name, String path) Take and save screenshot of a web element on the web page WebDriver is currently on. |
|
public static String |
saveWebElementScreenshotAndResize(WebDriver driver, WebElement ele, String name, String path) Take and save screenshot of a web element on the web page WebDriver is currently on. |
|
public static void |
selectOrDeselectAllOptions(Select select, boolean isSelect, TestObject to) |
|
public static void |
selectOrDeselectOptionsByIndex(Select select, Integer[] indexes, boolean isSelect, TestObject to) |
|
public static boolean |
selectOrDeselectOptionsByLabel(Select select, String label, boolean isRegex, boolean isSelect, TestObject to, String regularExpressionLog) |
|
public static boolean |
selectOrDeselectOptionsByValue(Select select, String value, boolean isRegex, boolean isSelect, TestObject to, String regularExpressionLog) |
|
public static void |
switchToDefaultContent() Internal method to switch to default content |
|
public static boolean |
switchToParentFrame(TestObject testObject, int timeOut) Switch to parent frames if test object has parent objects Switch to parent shadow roots if the parent object is shadow roots |
|
public static boolean |
switchToParentFrame(TestObject testObject) |
|
public static boolean |
switchToWindowUsingIndex(WebDriver webDriver, int index) |
|
public static boolean |
switchToWindowUsingTitle(WebDriver webDriver, String title, int timeOutInSeconds) |
|
public static boolean |
switchToWindowUsingUrl(WebDriver webDriver, String url) |
Methods inherited from class | Name |
---|---|
class KeywordHelper |
checkTestObjectParameter, checkTimeout, comparingNumberObject, indexRangeToArray, integerArrayToString, match |
Build a locator to find all elements satisfying at least one condition (regardless it is active or not)
If the TestObject has a cached WebElement then return this object, otherwise retrieve WebElement from TestObject's properties.
Take and save screenshot of a web element on the web page WebDriver is currently on. The image (if saved successfully) will be under PNG extension.
driver
- A WebDriver instance that's being used at the time calling
this functionele
- The web element to be taken screenshot ofname
- Name of the screenshotpath
- An absolute path to a folder to which the image will be savedTake and save screenshot of a web element on the web page WebDriver is currently on. The image (if saved successfully) will be under PNG extension.
driver
- A WebDriver instance that's being used at the time calling
this functionele
- The web element to be taken screenshot ofname
- Name of the screenshotpath
- An absolute path to a folder to which the image will be savedInternal method to switch to default content
Switch to parent frames if test object has parent objects Switch to parent shadow roots if the parent object is shadow roots