isSelected returns false and isChecked shows compilation error

前端 未结 1 1786
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-23 19:28
let checkBoxXpath = accessPolicyPage.listCheckBoxXpathS + i + accessPolicyPage.listCheckBoxXpathE;
//element(by.xpath(checkBoxXpath)).click();
expect(element(by.xpath(ch         


        
相关标签:
1条回答
  • 2021-01-23 19:38

    There is nothing called isChecked in Protractor. You can do this by using isSelected.

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

    Refer this to more information. Hope this helps. :)

    0 讨论(0)
提交回复
热议问题