Class InputKeysContainer

java.lang.Object
org.openqa.selenium.htmlunit.InputKeysContainer

public class InputKeysContainer extends Object
Converts a group of character sequences to a string to be sent by sendKeys.
Author:
Alexei Barantsev, Ahmed Ashour, Rob Winch
  • Constructor Details

    • InputKeysContainer

      public InputKeysContainer(CharSequence... sequences)
      Creates a new InputKeysContainer containing the specified character sequences.

      This constructor does not trim characters past an ENTER or RETURN key if present.

      Parameters:
      sequences - one or more sequences of characters to include in the container
    • InputKeysContainer

      public InputKeysContainer(boolean trimPastEnterKey, CharSequence... sequences)
      Creates a new InputKeysContainer containing the specified character sequences, with the option to trim content after the first ENTER or RETURN key.

      If trimPastEnterKey is true and the character sequences contain an ENTER or RETURN key, the container will truncate the content at the first occurrence of that key.

      Parameters:
      trimPastEnterKey - if true, truncate content after the first ENTER/RETURN key
      sequences - one or more sequences of characters to include in the container
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • wasSubmitKeyFound

      public boolean wasSubmitKeyFound()
      Returns whether a submit key (ENTER or RETURN) was found in the input sequences.
      Returns:
      true if a submit key was found; false otherwise
    • setCapitalization

      public void setCapitalization(boolean capitalize)
      Sets whether the input sequences should be capitalized.
      Parameters:
      capitalize - true to enable capitalization; false to disable