Class Actions


public class Actions extends ElementActions
  • Constructor Details

    • Actions

      public Actions()
    • Actions

      public Actions(org.openqa.selenium.WebDriver driver)
    • Actions

      public Actions(org.openqa.selenium.WebDriver driver, boolean isSilent)
    • Actions

      public Actions(DriverFactoryHelper helper)
  • Method Details

    • and

      public Actions and()
      Overrides:
      and in class ElementActions
    • hover

      @Step("Hover") public Actions hover(@NonNull @NonNull org.openqa.selenium.By locator)
      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 class ElementActions
      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

      @Step("Click") public Actions click(@NonNull @NonNull org.openqa.selenium.By locator)
      Description copied from class: ElementActions
      Clicks on a certain element using Selenium WebDriver, or JavaScript
      Overrides:
      click in class ElementActions
      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 class ElementActions
      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

      @Step("Double click") public Actions doubleClick(@NonNull @NonNull org.openqa.selenium.By locator)
      Description copied from class: ElementActions
      Double-clicks on an element using Selenium WebDriver's Actions Library
      Overrides:
      doubleClick in class ElementActions
      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 class ElementActions
      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 class ElementActions
      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

      @Beta @Step("Click") public Actions click(@NonNull @NonNull String elementName)
    • type

      @Step("Type") public Actions type(@NonNull @NonNull org.openqa.selenium.By locator, @NonNull @NonNull CharSequence... text)
      Overrides:
      type in class ElementActions
    • 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 class ElementActions
      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 class ElementActions
      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

      @Step("Clear") public Actions clear(@NonNull @NonNull org.openqa.selenium.By locator)
      Overrides:
      clear in class ElementActions
    • 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 class ElementActions
      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 class ElementActions
      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 moved
      yOffset - the vertical offset by which the element should be moved
      Returns:
      a self-reference to be used to chain actions
    • get

    • waitUntil

      @Step("Wait until") public Actions waitUntil(@NonNull @NonNull Function<? super org.openqa.selenium.WebDriver,?> isTrue)
    • waitUntil

      @Step("Wait until") public Actions waitUntil(@NonNull @NonNull Function<? super org.openqa.selenium.WebDriver,?> isTrue, @NonNull @NonNull Duration timeout)