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 Classes -
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 offsetget()
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, waitUntilPresenceOfAllElementsLocatedBy
Methods 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:
and
in classElementActions
-
hover
Description copied from class:ElementActions
Hovers 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:
hover
in 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:ElementActions
Clicks on a certain element using Selenium WebDriver, or JavaScript- Overrides:
click
in 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:ElementActions
Waits for the element to be clickable, and then clicks and holds it.- Overrides:
clickAndHold
in 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:ElementActions
Double-clicks on an element using Selenium WebDriver's Actions Library- Overrides:
doubleClick
in 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:ElementActions
Clicks on certain element using javaScript only- Overrides:
clickUsingJavascript
in 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:ElementActions
Used to SetProperty value for an element (hidden or visible) using javascript- Overrides:
setValueUsingJavaScript
in 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:
type
in 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:ElementActions
Checks 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:
typeSecure
in 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:ElementActions
Appends the required string into the target element, regardless of the current text value.- Overrides:
typeAppend
in 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:
clear
in classElementActions
-
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:ElementActions
Drags the source element and drops it onto the destination element- Overrides:
dragAndDrop
in 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:ElementActions
Drags the source element and drops it onto the determined offset- Overrides:
dragAndDropByOffset
in 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
-
waitUntil
-
waitUntil
-