Forum Discussion
Hi,
> I have to verify that the checkbox is checked or not
As it can be seen from the HTML source code and Object Browser in TestComplete, your checkbox is just an empty <i> element inside <td>. <td> is recognized by TestComplete as Cell and this is how it was mapped in NameMapping. Because <i> is an empty tag it is not present in the Object Browser and is not natively recognized and supported by TestComplete.
With this background knowledge, your actions may be like this:
a) Get the needed table cell;
b) Using the cell as a root, search for its <i> native child and get the value of its class attribute;
c) Check whether the obtained value contains the substring that is present only when checkbox is selected (fa-check-circle-o) and proceed appropriately.
To get the cell (point a) ), you may either use NameMapping (like in the recording that you provided) or search for it using FindChild() method.
Assuming that you already have a cell object, use FindChildByXPath() method to get <i> child and the value of its class attribute. I cannot verify exact XPath at the moment, but it may look like this:
classValue = table.cell.FindChildByXPath("./i/@class")
(that stands for: get value of the class attribute for the 'i' child of current element)
Related Content
- 11 months agoShivani3
- 4 years agoBea
- 11 years agoer_amitgupta198