Class SwitchElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.checkbox.testbench.SwitchElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasHelper, HasLabel, HasPropertySettersGetters, HasSearchContext, HasTestBenchCommandExecutor, HasValidation, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

public class SwitchElement extends TestBenchElement implements HasLabel, HasHelper, HasValidation
A TestBench element representing a <vaadin-switch> element.
  • Constructor Details

    • SwitchElement

      public SwitchElement()
  • Method Details

    • isChecked

      public boolean isChecked()
      Checks whether the switch is checked (on).
      Returns:
      true if the switch is on, false if it is off
    • setChecked

      public void setChecked(boolean checked)
      Sets whether the switch is checked (on).
      Parameters:
      checked - true to turn the switch on, false to turn it off
    • getLabel

      public String getLabel()
      Description copied from interface: HasLabel
      Gets the label for the element.
      Specified by:
      getLabel in interface HasLabel
      Returns:
      the label or an empty string if there is no label