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).
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.
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,
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)
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.