protractorischecked

How do I implement isChecked in Protractor


I'm new to protractor and I need to know how to write a protractor script to check whether a check box is checked or not. I searched every where to find is there anything called isChecked and I couldn't find.

Please help.

Thanks. :)


Solution

  • Please check my answer here. There is nothing called isCheckedin Protractor.

    You can use isSelectto do the same thing.

    webdriver.WebElement.prototype.isSelected = function() {
      return this.schedule_(
          new webdriver.Command(webdriver.CommandName.IS_ELEMENT_SELECTED),
          'WebElement.isSelected()');
    };
    

    Hope my answer helps you. :)