Package com.anhtester.utils
Class ObjectUtils
java.lang.Object
com.anhtester.utils.ObjectUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.openqa.selenium.BygetByFromWebElement(org.openqa.selenium.WebElement element) static org.openqa.selenium.BygetByLocatorFromConfig(String elementName) static org.openqa.selenium.BygetByLocatorFromString(String locatorToString) static StringgetXpathDynamic(String xpath, Object... value) Receives a wildcard string, replace the wildcard with the value and return to the callerstatic StringgetXpathValue(String elementName)
-
Constructor Details
-
ObjectUtils
public ObjectUtils()
-
-
Method Details
-
getByFromWebElement
public static org.openqa.selenium.By getByFromWebElement(org.openqa.selenium.WebElement element) -
getByLocatorFromString
-
getByLocatorFromConfig
-
getXpathValue
-
getXpathDynamic
Receives a wildcard string, replace the wildcard with the value and return to the caller- Parameters:
xpath- Xpath with wildcard stringvalue- multi value to be replaced in place of wildcard VD: ObjectUtils.getXpathDynamic("//button[normalize-space()='%s']//div[%d]//span[%d]", "Login", 2, 10);- Returns:
- dynamic xpath string
-