Ask a Question

Retrieve the value of checkbox linked to a label

SOLVED
enriquebravo
Contributor

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.

2 REPLIES 2
AlexKaras
Community Hero

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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

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.

cancel
Showing results for 
Search instead for 
Did you mean: