How to Click on the multiple checkbox?

Hi Guys,

Hope you are having a good day.

I have one query, I have to click on multiple check box. I am not getting an exact element to use i thought to use the Switch but got confused. I have heard of “For Each UI Element” but never used.
Example, Suppose if its EU then we have to tick (AT, FR, DE, IT FI, etc).

Can you please help me do that.

Hi @Vivek_Pandey2

Use for each Ui element activity and indicate the checkboxes. It will iterate the each Ui element inside for each insert the Check\uncheck activity to check the elements. Pass the CurrentElement in the Input element option of Check\Uncheck activity properties.

Check the below thread

Hope it helps!!

Hello
if you have the array [AT, FR, DE, IT, FI] u can use the for each and inside use anchore base
like this in the photo


Inside of the Find Element use code as a string vrbl to indicate the specific code for the check

Hi @Luciano_Gjinaj

As you said you can use the For each Ui element activity to make it dynamic. Follow the steps for your better understanding,
→ Create a List Variable called List_CheckElements and store the Input in this variable by using assign activity.

- Assign -> List_CheckElements = New List(Of String) From {"AT","FR","DE","IT","FI"}

→ Then drag and drop the For each Ui element activity and indicate on the first check box then it will automatically identify all the check boxes. Output of this activity is CurrentElement.
→ Inside For each Ui element activity insert the Get attribute activity and select the attribute which contains the Codes in the Table.
→ Give the CurrentElement to the Input Element option for the Get Attribute activity. Create a variable to the output of this activity called AttributeValue.
→ After Get Attribute activity insert the If condition to check the condition, give the below condition in If activity,

- Condition -> List_CheckElements.Any(AttributeValue.toString)

→ In Then block insert the Check/uncheck activity and pass the CurrentElement to the Input Element of this activity.

It works for you. Do modifications the flow based on your requirement.

Hope it helps!!

@mkankatala @pravallikapaluri I have read that but, i am not sure, how to use “For Each UI Element”


Do i have to set variable and then try to have the check/uncheck?
Also, If i use check/uncheck do i need to click 20 times (EU countries list)

Please advise and this for EU which has 20 countries in it… UK has 2 (GB, IE) , ANZ( AU & NZ)

It’s looooong past time you should be working in modern.

You don’t have to do this. You can indicate the text as the label for the UI element, then just use Current_Label in your comparison to List_CheckElements (might be CurrentLabel or CurrentElement_Label, I don’t remember exactly)

Hi @Vivek_Pandey2

For example i created a workflow see below

I am trying to click on Loan Code which Status is INACTIVE

Regards,

@lrtetala It doesn’t work in my case as it has the checkbox and its not clicking there… Also, is it due to i am working on studiox?

@mkankatala I have tried as you advised but show how its not picking up correctly.


Dont indicate any Ui element by using Get Attribute activity just give the CurrenElement to the Input Element option in properties of Get attribute activity,

There is Attribute dropdown right select the Attribute which contains the Code like AF, AL, DZ like that. Then it will be stored in the AttributeValue variable. You made this small mistake.

Do as I suggested and try, it works… @Vivek_Pandey2

Hope you understand!!

Hey @mkankatala ,

I am not sure, why its not working…
image

Also, just to let you know… it matches the territory from excel entry

image

If its EU, then it will select under the List_CheckElements

And also its not taking "List_CheckElements.Any(AttributeValue.toString) as its giving an error so its coming as below.


@mkankatala Thank you so much.

It really helpful.

1 Like

It’s my pleasure… @Vivek_Pandey2

Happy Automation!!

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