Xpath to determine checkbox “checked” attribute in Selenium IDE

前端 未结 5 742
无人及你
无人及你 2021-01-12 21:45

How to determine if a checkbox is check or not through xpath

Currently I am trying :

//input[@type=\'checkbox\' and @checked=\'true\')]
5条回答
  •  再見小時候
    2021-01-12 22:12

    However, there are solution without using css classes and selectors.

    Use

    //input[@type='checkbox' and @checked]
    

    or

    //input[@type='checkbox' and not(@checked)]
    

    instead of

    //input[@type='checkbox' and @checked='xyz']
    

提交回复
热议问题