How to get value of a "fake" checkbox?

Hello,

I’m trying to automate a custom software. In my process I want to verify if a checkbox is checked so I use the get Attribute activity with the argument “checked” but it was not working.

To try to solve this issue, I used the UI Explorer to get more information about the checkbox. The property explorer showed to me that the checkbox have “role = push button”, “cls = button” but no “checkbox” property or any properties that can display a value to do a condition.

In the software, the checkbox is associated with a label. If a click on the label (or the checkbox), the checkbox is working.

Any idea ? :slight_smile:

1 Like

Try using the get text and it should say ‘Checked’ or ‘Unchecked’ - this is what we have used.

Did you do a specific treatment on output of get text ?

I stored the output of “get text” in a variable then i used “write line” to display it but I can’t see nothing in the output console of uiPath. I put a default value in my variable so i guess it’s replaced by null ? I tried .toString but it didn’t help.

Assign the get text to checkboxstring (you do not need a default value)
use log message and try = "Checkbox = " + checkboxstring

Still the same issue :’(

Without having access to the selector it is hard to say- are you able to look at any other properties for that selector using UiExplorer?

Yes I’m able to get other properties of the element.

Here is the list of properties of my checkbox element.
As you can see, there is no “text” or “value” or “checked” property.

I tried get attribute “text” and get text on an other classic button, of course it’s working :slight_smile:

Hi @promo

Could you post a screen shot of all activities in the other state than the one above?

Sure :slight_smile:

First part

Open the application, click on few button and make a search for certain data. The last action is to click on the first result of the search.

Second part

The activity is on the same level as “sequence looking for data”.

I tried with a “attach window” activity because it’s a new window opened by the software.

But with “attach window” activity or without, the result is the same, I’m not able to get the checkbox.

Are you able to provide a screenshot of the full selector for the checkbox / push button using UiExplorer?

I am sorry, I phrased myself so awkwardly I caused you to write so much.

I meant the screenshot of the properites from the UiExplorer for both states of the checkbox - checked and unchecked.

I’m not sure if I understood correctly your question because I already posted a screenshot of the property box of UiExplorer (see 7th message). Informations are exactly the same if it’s checked or not :confused:

Here a screenshot of the selector :

It doesnt looked like you can get very far with that as it doesnt identify as a checkbox, nor build as one. Usually when a checkbox is displayed as a push button - there is underlying code that identifies it as a checkbox - its normally used for aesthetics and ease of use. So you could see where it links to and use that if you are able to access it.

Otherwise, another (not as efficient) solution would be to check if the image exists on that selector to see if it matches a tick or not.

Whenever I have problems with fake checkboxes I look at the innertext and outertext attributes. Often there will be something there to identify if the box is checked or not.

If there is no difference in the inner/outer text attributes, you will have to use some sort of image recognition, though that will be slow and not very reliable.

1 Like

Thank you for your suggestions.

How can I find the innertext and the outertext attributes ? I have nothing with UiExplorer…

Otherwise I tried the “Image Exists” activity but it’s not working on the checkbox. The returned value is always true whatever if the checkbox is checked or not.

I suppose @thediabloman meant the properties of the parent elements. If you click the parent elements, you should get other properties of that parent element and if lucky, it will contain something relevant:

As far as image recognition, try selecting the checkbox together with the text label, similar to how you indicated it in one of the screenshots above:
image

Yes I was not precise but I used the “Image exist” with the checkbox + label. I also read in an another topic on the forum that image recognition is not working for checkboxes…

I target the parent container in the software, I have exactly the same selector as the previous one except that the attributes cls (with the idx, last line (idx is different of course)) is “Static”.

So I guess I’m not lucky today :slight_smile:

This one is a tricky one. How about slightly increasing the accuracy property of your image activity?
image

Unfortunately it’s not working very well… I tried with 0.85, 0.90, 0.95 and 1 but the result is sometimes true sometimes false for the same checkbox state. :confused:

It is really hard to come-up with other ideas.

Try using Scraping Wizard with Full Text option on the entire window and also on parts of it. Maybe there is some hidden value somewhere?

Another idea would be to try and see if there is any feedback at all in other parts of the software after checking those checkboxes. Maybe some sort of hidden log message that can be extracted or a control that changes/displays the status. If so, use that as a way of seeing the change/status of the box.