Tuesday, 4 September 2012

Xpath to determine checkbox “checked” attribute

If there is multiple check-boxes with same ids and you have to select the next check-box which is not selected/checked. 
For such scenario you can refer below script - 

Here 'stnewrecord' is class of check-box. Script will store number of check-box, and according to that loop will follow. It will check whether check-box is checked or not if not it will check else move to next step.
This is xpath of check-box. 'i' is position, it will increase on each iteration.


  1. Clearly that's what I refer to a splendid blog article! Do you this domain for personal goals only or you have it to get profit from it?

  2. umm...directly it will help others and indirectly it will help me :P :)

  3. Thanks. It gave me some idea on something else i stuck on~~~