Forum Discussion

enriquebravo's avatar
enriquebravo
Contributor
3 years ago

Retrieve the value of checkbox linked to a label

I am testing a web application that has a Remember me checkbox. I would like to the script to set the value of the checkbox to true every time it runs, however the checkbox true/false value cannot be read as TC identified the checkbox and the label associated a one object identified by a "//label[contains(@class, 'checked')]" selector.

Is there anyway I could interact with the checkbox instead of the label? The spy is unable to identify the checkbox.

 

Thanks.

  • Hi,

     

    Most probably, developers implemented label styled as checkbox.

    Check either page markup or talk to developers to double-check this.

    Checkbox markup element will obviously be absent on the page and thus there will be no way for TestComplete to find it if the entity that looks like a checkbox is implemented as styled label.

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Most probably, developers implemented label styled as checkbox.

    Check either page markup or talk to developers to double-check this.

    Checkbox markup element will obviously be absent on the page and thus there will be no way for TestComplete to find it if the entity that looks like a checkbox is implemented as styled label.

     

    • enriquebravo's avatar
      enriquebravo
      Contributor

      Hey AlexKaras , thanks for your help. There are a number of object which were implemented differently than the object that they represent. I  used another testing tool and found a button that was implemented as a div container, so yeah, need to contact the devs.

       

      Thanks again.