public class Utilities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Utilities.OperatingSystem |
static class |
Utilities.SystemArchitecture |
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.WebElement |
findElement(Page.PageElement element,
Object... args)
Find the first
WebElement using the given method. |
static org.openqa.selenium.WebElement |
findElement(Page page,
String code,
Object... args)
Find the first
WebElement using the given method. |
static org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.WebDriver webDriver,
String applicationKey,
String code,
Object... args)
Find the first
WebElement using the given method. |
static org.openqa.selenium.By |
getLocator(Page.PageElement element,
Object... args)
This method read a application descriptor file and return a
By object (xpath, id, link ...). |
static org.openqa.selenium.By |
getLocator(Page page,
String code,
Object... args)
This method read a application descriptor file and return a
By object (xpath, id, link ...). |
static org.openqa.selenium.By |
getLocator(String applicationKey,
String code,
Object... args)
This method read a application descriptor file and return a
By object (xpath, id, link ...). |
static String |
getLocatorValue(Page.PageElement element,
Object... args) |
static String |
getSelectorValue(String applicationKey,
String code,
Object... args) |
static boolean |
isElementPresent(org.openqa.selenium.By element)
Check if element {link org.openqa.selenium.By} is present.
|
static org.openqa.selenium.WebElement |
isElementPresentAndGetFirstOne(org.openqa.selenium.By element)
Check if element present and get first one.
|
static String |
setProperty(String value,
String defValue)
Set value to a variable (null is forbiden, so set default value).
|
public static String getSelectorValue(String applicationKey, String code, Object... args)
applicationKey
- is key of applicationcode
- is key of selector (CAUTION: if you use any % char. String.format(String, Object...)
)args
- is list of args (String.format(String, Object...)
)public static String getLocatorValue(Page.PageElement element, Object... args)
element
- is a PageElementargs
- is list of args (String.format(String, Object...)
)public static org.openqa.selenium.By getLocator(String applicationKey, String code, Object... args)
By
object (xpath, id, link ...).applicationKey
- Name of application. Each application has its fair description file.code
- Name of element on the web Page.args
- list of description (xpath, id, link ...) for code.By
object (xpath, id, link ...)public static org.openqa.selenium.By getLocator(Page page, String code, Object... args)
By
object (xpath, id, link ...).page
- is target pagecode
- Name of element on the web Page.args
- list of description (xpath, id, link ...) for code.By
object (xpath, id, link ...)public static org.openqa.selenium.By getLocator(Page.PageElement element, Object... args)
By
object (xpath, id, link ...).element
- is PageElement find in page.args
- list of description (xpath, id, link ...) for code.By
object (xpath, id, link ...)public static org.openqa.selenium.WebElement findElement(org.openqa.selenium.WebDriver webDriver, String applicationKey, String code, Object... args)
WebElement
using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.webDriver
- instance of webDriverapplicationKey
- key of applicationcode
- Name of element on the web Page.args
- can be a index iWebElement
using the given methodpublic static org.openqa.selenium.WebElement findElement(Page page, String code, Object... args)
WebElement
using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.page
- is target pagecode
- Name of element on the web Page.args
- can be a index iWebElement
using the given methodpublic static org.openqa.selenium.WebElement findElement(Page.PageElement element, Object... args)
WebElement
using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.element
- is PageElement find in page.args
- can be a index iWebElement
using the given methodpublic static String setProperty(String value, String defValue)
value
- is value setted if value is not null.defValue
- is value setted if value is null.public static org.openqa.selenium.WebElement isElementPresentAndGetFirstOne(org.openqa.selenium.By element)
element
- is {link org.openqa.selenium.By} find in page.public static boolean isElementPresent(org.openqa.selenium.By element)
element
- is {link org.openqa.selenium.By} find in page.Copyright © 2023 NoraUi. All rights reserved.