Package com.shaft.gui.element.internal
Class Actions
java.lang.Object
com.shaft.driver.internal.FluentWebDriverAction
com.shaft.gui.element.ElementActions
com.shaft.gui.element.internal.Actions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Constructor Summary
ConstructorsConstructorDescriptionActions()Actions(DriverFactoryHelper helper) Actions(org.openqa.selenium.WebDriver driver) Actions(org.openqa.selenium.WebDriver driver, boolean isSilent) -
Method Summary
Modifier and TypeMethodDescriptionand()clear(@NonNull org.openqa.selenium.By locator) click(@NonNull org.openqa.selenium.By locator) Clicks on a certain element using Selenium WebDriver, or JavaScriptclickAndHold(@NonNull org.openqa.selenium.By locator) Waits for the element to be clickable, and then clicks and holds it.clickUsingJavascript(@NonNull org.openqa.selenium.By locator) Clicks on certain element using javaScript onlydoubleClick(@NonNull org.openqa.selenium.By locator) Double-clicks on an element using Selenium WebDriver's Actions LibrarydragAndDrop(@NonNull org.openqa.selenium.By sourceElementLocator, @NonNull org.openqa.selenium.By destinationElementLocator) Drags the source element and drops it onto the destination elementdragAndDropByOffset(@NonNull org.openqa.selenium.By sourceElementLocator, int xOffset, int yOffset) Drags the source element and drops it onto the determined offsetdropFileToUpload(@NonNull org.openqa.selenium.By locator, @NonNull String filePath) get()hover(@NonNull org.openqa.selenium.By locator) Hovers over target element.setValueUsingJavaScript(@NonNull org.openqa.selenium.By locator, @NonNull String value) Used to SetProperty value for an element (hidden or visible) using javascripttype(@NonNull String elementName, @NonNull CharSequence... text) type(@NonNull org.openqa.selenium.By locator, @NonNull CharSequence... text) typeAppend(@NonNull org.openqa.selenium.By locator, @NonNull CharSequence... text) Appends the required string into the target element, regardless of the current text value.typeSecure(@NonNull org.openqa.selenium.By locator, @NonNull CharSequence... text) Checks if there is any text in an element, clears it, then types the required string into the target element.waitUntil(@NonNull Function<? super org.openqa.selenium.WebDriver, ?> isTrue, @NonNull Duration timeout) Methods inherited from class com.shaft.gui.element.ElementActions
assertThat, captureScreenshot, clipboardActions, executeNativeMobileCommand, getAttribute, getCSSProperty, getCurrentFrame, getElementsCount, getSelectedText, getTableRowsData, getText, hoverAndClick, isElementClickable, isElementDisplayed, scrollToElement, select, submitFormUsingJavaScript, switchToDefaultContent, switchToIframe, typeFileLocationForUpload, verifyThat, waitUntilAttributeContains, waitUntilElementTextToBe, waitUntilElementToBeSelected, waitUntilNumberOfElementsToBe, waitUntilNumberOfElementsToBeLessThan, waitUntilNumberOfElementsToBeMoreThan, waitUntilPresenceOfAllElementsLocatedByMethods inherited from class com.shaft.driver.internal.FluentWebDriverAction
alert, browser, element, initialize, initialize, initialize, initialize, performAlertAction, performBrowserAction, performElementAction, performTouchAction, touch
-
Constructor Details
-
Actions
public Actions() -
Actions
public Actions(org.openqa.selenium.WebDriver driver) -
Actions
public Actions(org.openqa.selenium.WebDriver driver, boolean isSilent) -
Actions
-
-
Method Details
-
and
- Overrides:
andin classElementActions
-
hover
Description copied from class:ElementActionsHovers over target element. If you want to hover on a webElement to expose another webElement and click on it, use hoverAndClick instead for a more reliable result.- Overrides:
hoverin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
click
Description copied from class:ElementActionsClicks on a certain element using Selenium WebDriver, or JavaScript- Overrides:
clickin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
clickAndHold
@Step("Click and hold") public Actions clickAndHold(@NonNull @NonNull org.openqa.selenium.By locator) Description copied from class:ElementActionsWaits for the element to be clickable, and then clicks and holds it.- Overrides:
clickAndHoldin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
doubleClick
Description copied from class:ElementActionsDouble-clicks on an element using Selenium WebDriver's Actions Library- Overrides:
doubleClickin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
clickUsingJavascript
@Step("Click using JavaScript") public Actions clickUsingJavascript(@NonNull @NonNull org.openqa.selenium.By locator) Description copied from class:ElementActionsClicks on certain element using javaScript only- Overrides:
clickUsingJavascriptin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
setValueUsingJavaScript
@Step("Set value using JavaScript") public Actions setValueUsingJavaScript(@NonNull @NonNull org.openqa.selenium.By locator, @NonNull @NonNull String value) Description copied from class:ElementActionsUsed to SetProperty value for an element (hidden or visible) using javascript- Overrides:
setValueUsingJavaScriptin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)value- the desired value that should be SetProperty for the target element- Returns:
- a self-reference to be used to chain actions
-
click
-
type
@Step("Type") public Actions type(@NonNull @NonNull org.openqa.selenium.By locator, @NonNull @NonNull CharSequence... text) - Overrides:
typein classElementActions
-
type
@Beta @Step("Type") public Actions type(@NonNull @NonNull String elementName, @NonNull @NonNull CharSequence... text) -
typeSecure
@Step("Type securely") public Actions typeSecure(@NonNull @NonNull org.openqa.selenium.By locator, @NonNull @NonNull CharSequence... text) Description copied from class:ElementActionsChecks if there is any text in an element, clears it, then types the required string into the target element. Obfuscates the written text in the output report. This action should be used for writing passwords and secure text.- Overrides:
typeSecurein classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)text- the target text that needs to be typed into the target webElement- Returns:
- a self-reference to be used to chain actions
-
typeAppend
@Step("Append") public Actions typeAppend(@NonNull @NonNull org.openqa.selenium.By locator, @NonNull @NonNull CharSequence... text) Description copied from class:ElementActionsAppends the required string into the target element, regardless of the current text value.- Overrides:
typeAppendin classElementActions- Parameters:
locator- the locator of the webElement under test (By xpath, id, selector, name ...etc.)text- the target text that needs to be appended into the target webElement- Returns:
- a self-reference to be used to chain actions
-
clear
- Overrides:
clearin classElementActions
-
dropFileToUpload
-
dragAndDrop
@Step("Drag and drop") public Actions dragAndDrop(@NonNull @NonNull org.openqa.selenium.By sourceElementLocator, @NonNull @NonNull org.openqa.selenium.By destinationElementLocator) Description copied from class:ElementActionsDrags the source element and drops it onto the destination element- Overrides:
dragAndDropin classElementActions- Parameters:
sourceElementLocator- the locator of the source webElement that should be dragged under test (By xpath, id, selector, name ...etc.)destinationElementLocator- the locator of the target webElement that should receive the dropped source element under test (By xpath, id, selector, name ...etc.)- Returns:
- a self-reference to be used to chain actions
-
dragAndDropByOffset
@Step("Drag and drop by offset") public Actions dragAndDropByOffset(@NonNull @NonNull org.openqa.selenium.By sourceElementLocator, int xOffset, int yOffset) Description copied from class:ElementActionsDrags the source element and drops it onto the determined offset- Overrides:
dragAndDropByOffsetin classElementActions- Parameters:
sourceElementLocator- the locator of the source webElement that should be dragged under test (By xpath, id, selector, name ...etc.)xOffset- the horizontal offset by which the element should be movedyOffset- the vertical offset by which the element should be moved- Returns:
- a self-reference to be used to chain actions
-
get
-
clipboard
-
waitUntil
-
waitUntil
-