Find text and click on checkbox

I have to match the text in excel with the text in the form on webpage and click on the checkbox beside it. The checkbox cannot be checked if I click on the text. The number of checkbox is unknown. I cannot use anchor base as I cannot change the selector in anchor base since the website address changes. I have tried using CV screen scope but it cannot select checkbox dynamically.

Hey @felicia

Use the check activity for checking radio buttons and checkboxes

Hi @felicia

I think as per @nv08 said u can use check activitiy for this

But in selector part u need to make sure that it should be dyanmic. I will explain this part step by step for this . for demonstartion i used the website
Forms : Check Box - HTML Tutorial for checkbox selection. You can see three checkbox options as below
image

Now use check activity and inidicate any checkbox corresponding to any name. Say for example, i had selected the checkbox corresponding to name Milk.

Now opened the from there opened uiexplorer for showing the selector of indicated area.

now in that selector i add a attribute value, giving the name whose checkbox u need to select. Fo eg, i need to select Butter so i put value attribute as Butter.
see the pic below

Selector :

 `<html app='chrome.exe' title='Forms : Check Box - HTML Tutorial' /><webctrl name='option*' tag='INPUT' type='checkbox' value='Butter' />

(Please note i put a option* since option1,option2,option3 etc will be coming when selecting the different checkboxes, so making it dynamic by *)

If u highlight using the modified selector u can see it is pointing towards the Butter checkbox.

Why we are using value attribute in this selector?

The reason is its html structure. In the webpage, u can see its checkboxes html source as below
image

So when u select the milk checkboxes value stored will be Milk like that…

So in ur case, u need to find the value of checkbox corresponding to each name by following the html structure.

So in this way u can select the checkbox according to name.

Hope it helps you

Mark it as solution if you got this as answer for ur query because many will find this as useful for same scenarios when they are searching in forum.

Regards
Nived N

Happy Automation

2 Likes