# Marking new checkboxes

**URL:** <https://community.smartbear.com/t/marking-new-checkboxes/351>\
**Category:** TestComplete\
**Tags:** test, testcomplete, migrated, web-testing\
**Created:** [January 27, 2025, 3:49pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351 "2025-01-27T15:49:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 3:49pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/1 "2025-01-27T15:49:10Z")

</div>

> Originally posted by **zeekbiboo** on January 27, 2025

Hi! I’m new to testcomplete. I’m working on some web tests and I’m learning how to use testcomplete at all.

Well, I wanted to do a test with some checkboxes, the page works in such a way that there are 5 checkboxes per page, being able to increase this number with a list. Once a person is selected and a request is created, their checkbox is disabled so that the chosen user only has one request in progress. Then the next testcomplete run tells me the error that the checkbox is not accessible since it sees it disabled.

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/397b317939a942979770c7e75f924368ae7198f6.png)

Is it possible to tell testcomplete to look for the closest checkbox that is available so that it automatically selects it?

Oh, sometimes when I use the object spy tool to manually tell testcomplete to check another box that is available at that time simply ignores me and launches the same error, even when I do the highlight thing to see if my mark was on the right spot. Idk why this happens, maybe is a code error

I’m only using keyword test bc I’m so noob with code and scripts. Thank u in advance and have a great day ☀

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 4:22pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/2 "2025-01-27T16:22:51Z")

</div>

> Originally posted by **Hassan\_Ballan** on January 27, 2025

Hello,

Refer to [https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/index.html](https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/index.html) for using Spy. Inspect Spy object detection to look for a property that checks the sate, for example enabled=true. Yo may need to switch the view from basic to advanced view.

You need to address it in two steps:  
1-The checkbox row, as you have 5 you need to have 5 different mappings one for each  
2-The checkbox state enabled or disabled added to detection properties

You could create KeywordTests with following simple logic:  
If checkbox1 property enabled equal true, click it and go to Label  
If checkbox2 property enabled equal true, click it and go to Label  
If checkbox4 property enabled equal true, click it and go to Label  
If checkbox5 property enabled equal true, click it  
Label

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 5:35pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/3 "2025-01-27T17:35:03Z")

</div>

> Originally posted by **JDR2500** on January 27, 2025

This might present an opportunity to dabble in scripts. What you’re describing could be accomplished in a very simple script. That script could then be called/run from your keyword test. Your keyword test would still be the thing you’d run from the execution plan. Your simple script would just take care of the checkbox checking part.

It could be accomplished in ~half a dozen lines in a script. For instance, the FindChild method would let you find a checkbox that’s enabled. Once found, you could click it directly in the script or in your Keyword test using a project variable.

Hassan\_Ballan’s suggestion is a good one too. However, it might become untenable if the number of check boxes grew well beyond five. That would require many name mappings.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 7:42pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/4 "2025-01-27T19:42:01Z")

</div>

> Originally posted by **Marsha\_R** on January 27, 2025

I like this solution, plus I would suggest that you clear out all the checkboxes at some point, maybe at the end of the test, so you know for certain that you are starting with all of them enabled the next time.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 8:02pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/5 "2025-01-27T20:02:39Z")

</div>

> Originally posted by **Hassan\_Ballan** on January 27, 2025

JDR2500 you are right in your assessment; however, as a new user and not code savvy I thought a simpler approach would go a long way with zeekbiboo.

There are many ways to deliver and without specifics it would also be hard to suggest the best approach. I will try to make an example for all interested to pitch in and be on the same page.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 27, 2025, 9:45pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/6 "2025-01-27T21:45:39Z")

</div>

> Originally posted by **Hassan\_Ballan** on January 27, 2025

Of course there is also a simpler way to avoid all the if statements, but that requires NameMapping manual manipulation for selectors element XPath, and that also require HTML investigation.

In the following sample project that use w3schools page for multiple checkbox:  
1-Added on the project level variable “row”  
2-In NameMapping I mapped all three CheckBoxes and manually added a new node (“checkboxVehicleX” with parameterized XPath using the “row” variable)  
3-In the testcase I set the “row” variable value to 1 and rest cache  
4-Than I use the “checkboxVehicleX” property Exists=true to loop thru and check the box, increment the value and reset the cache

zeekbiboo if you can dig such project example details, perhaps you can compare your check-boxes elements to find similarities and differences to simulate same approach.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2025, 9:38am UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/7 "2025-01-28T09:38:42Z")

</div>

> Originally posted by **rraghvani** on January 28, 2025

Like with all first time users of TestComplete, I recommended that you learn and understand how [https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/index.html](https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/index.html) works, this is a vital part of TestComplete, and [https://support.smartbear.com/testcomplete/docs/testing-with/index.html](https://support.smartbear.com/testcomplete/docs/testing-with/index.html)

Record and playback will not always work as you expect it too!

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2025, 3:46pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/8 "2025-01-28T15:46:33Z")

</div>

> Originally posted by **zeekbiboo** on January 28, 2025

hi,

I really appreciate ur solution and thank you for guiding me. I’ll dig on some examples like those mentioned, again thank you so much for ur time.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2025, 3:55pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/9 "2025-01-28T15:55:36Z")

</div>

> Originally posted by **zeekbiboo** on January 28, 2025

I was thinking the same yesterday, at the end of the day the scripts makes your test go easier and fluent I guess.

I’m gonna do some research and start with little footsteps bc as Hassan\_Ballan said I’m new to code and those things, so starting simple is the way I like.

Thank u so much for ur answer and time.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2025, 4:47pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/10 "2025-01-28T16:47:45Z")

</div>

> Originally posted by **scot1967** on January 28, 2025

If you haven’t seen these articles they may help…

Working with Textboxes…

[https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/web/check-box.html](https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/web/check-box.html)

"Is it possible to tell testcomplete to look for the closest checkbox that is available so that it automatically selects it? "

[https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/ai/ocr-action.html#description](https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/ai/ocr-action.html#description)

> When you add the operation to a keyword test, you specify an area whose text content you want to recognize, the text fragment that identifies the needed part of the area and the method that will simulate user actions.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2025, 6:49pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/11 "2025-01-28T18:49:30Z")

</div>

> Originally posted by **Hassan\_Ballan** on January 28, 2025

I envision you can do it by using a single mapping to be used for all checkboxes that always find the first enabled checkbox no matter how long is the list.

For below examples: In browser change checkbox state, in the TestComplete NameMapping make edits and use the buttons Refresh and Highlight to validate

![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/15335672171e997ffa85083b75f47ea15298afeb.png)

1-[W3Schools Tryit Editor](https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref)\_checkbox\_checked2 demonstrate checkbox checked and unchecked  
change the name mapping selector to CSS and set value to  
input:not(:checked)[type=‘checkbox’]

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/5c724a83d9e7dec1d62723c39d0f1b77aba96f17.png)

2-[W3Schools Tryit Editor](https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref)\_checkbox\_disabled2 demonstrate checkbox enabled and disabled  
change the name mapping selector to CSS and set value to  
input:not(:disabled)[type=‘checkbox’]

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/cb370088206b9f0f9e09374ca7f492e4699018e0.png)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:15pm UTC](https://community.smartbear.com/t/marking-new-checkboxes/351/12 "2026-10-07T17:15:49Z")

</div>

Closed on October 7, 2026, 5:15pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
