Checkbox Slider Status unable to get

Hi @Birger,

The HTML snippet you gave is not a single element but rather a series of elements that make a styled object on a page.

The element you are selecting is only this:

<mat-slide-toggle _ngcontent-aim-c589="" class="mat-slide-toggle slide-toggle mat-accent" data-at-whatever="false" id="mat-slide-toggle-3">

Because this is not an <input> element of type “checkbox” or “radio”, Browser.Get Checkbox State will not work.

Likewise because the element you selected doesn’t have an attribute of “aria-checked”, Browser.Get Attribute and Browser.Get Property will probably fail with a message telling you that.

From looking at your HTML snippet there are a few things you could try:

  • Browser.Get Checkbox State //*[@data-at-whatever]/input
  • Browser.Get Attribute //*[@data-at-whatever]/input aria-checked
  • Browser.Get Attribute //*[@data-at-whatever] data-at-whatever

There’s other ways as well but ,I think these will probably give you the result you are after without too much complexity.

Dave.