Package com.shaft.gui.element.internal
Class ElementActionsHelper
java.lang.Object
com.shaft.gui.element.internal.ElementActionsHelper
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changeWebElementVisibilityUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, boolean desiredIsVisibleState) void
clickUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) createReportMessage
(String actionName, String testData, String elementName, Boolean passFailStatus) void
dragAndDropUsingActions
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By sourceElementLocator, org.openqa.selenium.By destinationElementLocator) void
dragAndDropUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By sourceElementLocator, org.openqa.selenium.By destinationElementLocator) void
executeNativeMobileCommandUsingJavascript
(org.openqa.selenium.WebDriver driver, String command, Map<String, String> parameters) void
failAction
(org.openqa.selenium.WebDriver driver, String actionName, String testData, org.openqa.selenium.By elementLocator, List<List<Object>> screenshots, Throwable... rootCauseException) void
failAction
(org.openqa.selenium.WebDriver driver, String testData, org.openqa.selenium.By elementLocator, Throwable... rootCauseException) void
failAction
(org.openqa.selenium.WebDriver driver, String testData, org.openqa.selenium.By elementLocator, List<List<Object>> attachments, Throwable... rootCauseException) void
failAction
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, Throwable... rootCauseException) getElementName
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) int
getElementsCount
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) Returns the number of elements that match a certain elementLocatorgetMatchingElementsInformation
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, boolean checkForVisibility, Object... action) org.openqa.selenium.WebElement
getWebElementFromPointUsingJavascript
(org.openqa.selenium.WebDriver driver, List<Integer> point, boolean scrollToElement) identifyUniqueElement
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) identifyUniqueElementIgnoringVisibility
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) boolean
isFoundInStacktrace
(Class<?> classObject, Throwable throwable) void
passAction
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String actionName, String testData, List<List<Object>> screenshots, String elementName) void
passAction
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String testData, List<Object> screenshot, String elementName) performActionAgainstUniqueElement
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, Object... action) performActionAgainstUniqueElementIgnoringVisibility
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, Object... action) boolean
performClipboardActions
(org.openqa.selenium.WebDriver driver, ClipboardAction action) readElementText
(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation) reportActionResult
(org.openqa.selenium.WebDriver driver, String actionName, String testData, org.openqa.selenium.By elementLocator, List<List<Object>> screenshots, String elementName, Boolean passFailStatus, Throwable... rootCauseException) scrollToFindElement
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) boolean
setValueUsingJavascript
(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation, String value) boolean
setValueUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String value) void
submitFormUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) suggestNewXpathUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement targetElement) suggestNewXpathUsingJavascript
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement targetElement, org.openqa.selenium.By deprecatedElementLocator) takeScreenshot
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String actionName, String testData, boolean passFailStatus) typeWrapper
(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation, String targetText) boolean
waitForElementAttributeToBe
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String att, String expectedValue) Waits for the attribute of the specified element to be a specific value.boolean
waitForElementInvisibility
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) waitForElementPresence
(org.openqa.selenium.WebDriver driver, String elementReferenceScreenshot) waitForElementPresence
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) waitForElementPresence
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, boolean checkForVisibility, Object... action) int
waitForElementPresenceWithReducedTimeout
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) boolean
waitForElementTextToBeNot
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String textShouldNotBe) boolean
waitForElementToBeClickable
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String actionToExecute)
-
Field Details
-
OBFUSCATED_STRING
- See Also:
-
-
Constructor Details
-
ElementActionsHelper
public ElementActionsHelper(boolean isSilent)
-
-
Method Details
-
waitForElementPresenceWithReducedTimeout
public int waitForElementPresenceWithReducedTimeout(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) -
waitForElementPresence
-
waitForElementPresence
-
waitForElementInvisibility
public boolean waitForElementInvisibility(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) -
waitForElementPresence
-
scrollToFindElement
-
waitForElementToBeClickable
public boolean waitForElementToBeClickable(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String actionToExecute) -
waitForElementTextToBeNot
public boolean waitForElementTextToBeNot(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String textShouldNotBe) -
waitForElementAttributeToBe
public boolean waitForElementAttributeToBe(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String att, String expectedValue) Waits for the attribute of the specified element to be a specific value.- Parameters:
driver
- the WebDriver instance used to interact with the browserelementLocator
- the locator used to find the elementatt
- the name of the attribute to wait forexpectedValue
- the expected value of the attribute- Returns:
- true if the attribute value matches the expected value within the timeout period, otherwise false
-
getWebElementFromPointUsingJavascript
-
clickUsingJavascript
public void clickUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) -
dragAndDropUsingJavascript
public void dragAndDropUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By sourceElementLocator, org.openqa.selenium.By destinationElementLocator) -
dragAndDropUsingActions
public void dragAndDropUsingActions(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By sourceElementLocator, org.openqa.selenium.By destinationElementLocator) -
executeNativeMobileCommandUsingJavascript
-
submitFormUsingJavascript
public void submitFormUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) -
changeWebElementVisibilityUsingJavascript
public void changeWebElementVisibilityUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, boolean desiredIsVisibleState) -
setValueUsingJavascript
public boolean setValueUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, String value) -
setValueUsingJavascript
public boolean setValueUsingJavascript(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation, String value) -
suggestNewXpathUsingJavascript
public String suggestNewXpathUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement targetElement) -
suggestNewXpathUsingJavascript
public String suggestNewXpathUsingJavascript(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement targetElement, org.openqa.selenium.By deprecatedElementLocator) -
takeScreenshot
-
getElementName
public String getElementName(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) -
performClipboardActions
public boolean performClipboardActions(org.openqa.selenium.WebDriver driver, ClipboardAction action) -
readElementText
public String readElementText(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation) -
typeWrapper
public String typeWrapper(org.openqa.selenium.WebDriver driver, ElementInformation elementInformation, String targetText) -
isFoundInStacktrace
-
performActionAgainstUniqueElement
-
performActionAgainstUniqueElementIgnoringVisibility
-
identifyUniqueElement
-
identifyUniqueElementIgnoringVisibility
-
getMatchingElementsInformation
-
getElementsCount
public int getElementsCount(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator) Returns the number of elements that match a certain elementLocator- Parameters:
driver
- the current instance of Selenium WebDriverelementLocator
- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- integer value that represents the number of elements that match the desired elementLocator
-
passAction
-
passAction
-
failAction
public void failAction(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, Throwable... rootCauseException) -
failAction
-
failAction
-
failAction
-
createReportMessage
-
reportActionResult
-