Class Select

All Implemented Interfaces:
Composable, MultiPhased

public class Select extends MultiPhaseAction
Select is a subclass of MultiPhaseAction which selects/deselects options on a SELECT element. StaleElementReferenceException may happen while Select tries to manipulate the element, so multi-phase is used to perform the action again.
Author:
Kimberly
  • Constructor Details

    • Select

      public Select(org.openqa.selenium.By by, Select.SelectBy selectBy, Object... options)
      Create an action to perform selection against a specific element.
      Parameters:
      by - the element locating mechanism
      selectBy - the way to perform the selecting
      options - the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
    • Select

      public Select(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, Select.SelectBy selectBy, Object... options)
      Create an action to perform selection against a specific element.
      Parameters:
      by - the element locating mechanism
      frameBySequence - the sequence of the frame locating mechanism for the element resides in frame(or frame in another frame and so on)
      selectBy - the way to perform the selecting
      options - the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
  • Method Details

    • clickToSelect

      public static void clickToSelect(org.openqa.selenium.WebElement element, Select.SelectBy selectBy, Object... options)
      Clicks an element and then performs selecting on it.
      Parameters:
      element - the element to perform the selecting
      selectBy - the way to perform the selecting
      options - the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
    • performMultiPhase

      protected void performMultiPhase()
      Description copied from class: MultiPhaseAction
      Perform multiple-phased browser action. MultiPhaseAction.noNextPhase() needs to be invoked to signal that there is no more phase to execute.
      Specified by:
      performMultiPhase in class MultiPhaseAction
    • toString

      public String toString()
      Overrides:
      toString in class MultiPhaseAction