How to check if a checkbox is checked or unchecked in a drop down list?

Hi all,

I have a dropdown list of value with checkboxes.

How do I achieve checking if the boxes are checked or unchecked ?

Please attach an xaml file for easy understanding.

Thanks,
Uio.

Hi @uio ,

Please go through this article: How to check if checkbox is checked or unchecked

This method doesn’t work in drop down lists I guess.

You can use find children to get all check box elements of your dropdown list and after looping over them, use Get Attribute inside foreach.

@uio

You can use a “Get Attribute” activity to check if the checkboxes in a dropdown list are checked or unchecked.

Here’s a one-line solution for checking the “checked” attribute of a checkbox

yourCheckboxElement.Get("checked").ToString()

try this flow :

  1. Add a “Get Attribute” activity to your workflow.
  2. Indicate the checkbox element within the dropdown list.
  3. Set the “Attribute” property to “checked”.
  4. Assign the result to a variable or use it directly in your workflow.

I’m unable to provide an XAML file directly, but you can easily create one by following these steps. If you encounter any issues or need more specific guidance, please let me know, and I’ll be happy to assist you further.

cheers…!

Due to some reasons, I cannot update my studio to the latest version. So I don’t have “Find Children” activity. A regex might help.

@uio , Find children activity is always there as I remember, you must be missing something like activity filters etc…

Hello @uio

  1. Create a new Sequence in UiPath
  2. Use the “Open Browser” activity to open the web page containing the dropdown list with checkboxes. Specify the URL in the activity properties.
  3. Use the “Click” activity to click on the dropdown to expand the list.
  4. Use the “Find Children” activity to identify and collect all the checkboxes within the dropdown list. In the Selector property, you should indicate the common parent element containing all the checkboxes.
  5. Add a “For Each” activity to loop through each checkbox found.
  6. Within the loop, use the “Get Attribute” activity to check the “checked” attribute of each checkbox element. The “checked” attribute will contain “True” if the checkbox is checked or “False” if it’s unchecked.
  7. Use an “If” activity to check the value of the “checked” attribute.
  8. In the “Then” section of the “If” activity, you can add actions to handle checked checkboxes.
  9. In the “Else” section of the “If” activity, you can add actions to handle unchecked checkboxes.

Thanks & Cheers!!!

@uio

  1. First perform a click on the dropdown
  2. Use find children activity to get all the check box details indicidually into elements…if not…we can use a for loop with changing idx in the selector as 1,2,3 etc till we do not have elments or dropdowns available
  3. Inside the that use get attribute to check the status of check box for each elemnt in the dropdown

To identify the attribute indicate the elemnet in ui explorer and check which property is changing when check and unchecked…right top and bottom left panels will help in ifentifiying the attribute name

Cheers