Skip to main content
Solved

How to know if a checkbox is checked or not

  • October 9, 2024
  • 7 replies
  • 259 views

Forum|alt.badge.img+11

Hello everyone,

 

I would like to use the register:capture tool to know if a checkbox is checked or not.

I can perfectly do a left click that will switch it status, but how to get its current status ?

 

Does anyone have a clue ?

Best answer by Dineshkumar Muthu

Hi @Augustin ,

It’s working with JavaScript. Refer the attached screenshot.

 

7 replies

Dineshkumar Muthu
Flight Specialist | Tier 4
Forum|alt.badge.img+9

Hi @Augustin ,

 

To determine the current status of a checkbox using Automation Anywhere A360, you can use the Capture action to interact with the checkbox and then use the If/Else condition to check its status. Here’s a step-by-step guide:

  1. Capture the Checkbox:

    • Use the Capture action to select the checkbox element on your screen.
  2. Get the Checkbox Status:

    • After capturing the checkbox, use the Get Property action to retrieve the checkbox’s properties.
    • Specifically, you want to get the property that indicates whether the checkbox is checked or not. This is usually the checked property.
  3. Use If/Else Condition:

    • Use an If/Else condition to check the value of the checked property.
    • If the checked property is true, the checkbox is checked. If it is false, the checkbox is unchecked.

Here’s a sample workflow:

  1. Capture Action:

    • Capture the checkbox element.
  2. Get Property Action:

    • Select the captured checkbox element.
    • Choose the checked property to retrieve its value.
  3. If/Else Condition:

    • Use the If/Else condition to check the value of the checked property.
    • If checked is true, perform actions for a checked checkbox.
    • If checked is false, perform actions for an unchecked checkbox.

 

 If these steps help you resolve the problem, please mark it as answered. If you need further assistance or have other questions, feel free to ask!


Forum|alt.badge.img+11
  • Author
  • Flight Specialist | Tier 4
  • October 9, 2024

Hi @Augustin ,

    • After capturing the checkbox, use the Get Property action to retrieve the checkbox’s properties.
    • Specifically, you want to get the property that indicates whether the checkbox is checked or not. This is usually the checked property

There is no “checked” property in the Recorder:Capture component.

Could you send me a screenshot of the component having that property ?

 

 


Dineshkumar Muthu
Flight Specialist | Tier 4
Forum|alt.badge.img+9

Hi @Augustin, Can you share the screenshot of the object which you're trying to capture?

 


Forum|alt.badge.img+11
  • Author
  • Flight Specialist | Tier 4
  • October 9, 2024

Hi @Augustin, Can you share the screenshot of the object which you're trying to capture?

 

It is a customer website, so I fear it is not possible to share a screenshot of it.

But it is the same here : https://materializecss.com/radio-buttons.html

The only parameter that could work is “States”, but not all websites use it

 


Dineshkumar Muthu
Flight Specialist | Tier 4
Forum|alt.badge.img+9
  • Flight Specialist | Tier 4
  • Answer
  • October 11, 2024

Hi @Augustin ,

It’s working with JavaScript. Refer the attached screenshot.

 


Forum|alt.badge.img+11
  • Author
  • Flight Specialist | Tier 4
  • October 11, 2024

I have found another way : using the Image Recognition package and compare with a screenshot of the same page, with ( or without ) the box checked.

Needless to say, being able to get the information with the recorder:capture package would be better


Dineshkumar Muthu
Flight Specialist | Tier 4
Forum|alt.badge.img+9

Hi @Augustin, Image recognition is not reliable, it can fail any time. Image recognition will take more time.  You can consider JavaScript as a reliable solution.