Help needed for dynamic selectors on google form

Hi everyone, trying to select an option in a google form based on the value read in the current row in the excel table. Here is an image of the options

I have managed to create a variable for the text that I want to select. The variable is called Event_value , however I cannot seem to get my automation to click on the correct value.

My fuzzy selector is "<webctrl aaname='{{Event_value}}' tag='SPAN' check:innerText='{{Event_value}}' />" and my strict selector is <webctrl aaname='{{Event_value}}' tag='SPAN' /> and my window selector is <html app='chrome.exe' title='RPA Form' />

I did not select an anchor. When I select the “Morning” option the fuzzy selector is "<webctrl aaname='Morning' tag='SPAN' type='' class='aDTYNe snByac OvPDhc OIC90c' check:innerText='Morning' />" and the strict selector is <webctrl aaname='Morning' tag='SPAN' /> . For the “Supper” option the selectors are "<webctrl aaname='Supper' tag='SPAN' type='' class='aDTYNe snByac OvPDhc OIC90c' check:innerText='Supper' />" and <webctrl aaname='Supper' tag='SPAN' />

I would really appreciate some help on this matter, thank you.

Hi @honghong

The selector innertext are case sensitive. Can you check if the value is exactly matching?

and manually did you try to change the innertext and aaname and did you validate it?

Also you need not give both aaname and inertext either of those should be enough

and try moving the tag to the first of selector


Hi, yes the value of my variable is exactly matching.

I have tried changing innvertext and aaname to other values such as “Supper” and they work fine.

I tried to validate for the strict selector but it doesnt validate. But I assume this is normal since its a dynamic selector?

Absolutely. Dynamic selector won’t validate. You need to actually debug/run.


Try giving a default value and you can check strict as well.

Can we get the sample form?


Yep, running it seems to be really weird, even after I have changed to a dynamic selector, it will still select the old option. E.g. if i used selector on “Afternoon” and then changed the selector, it will still select “Afternoon”. If i used selector on “Supper” and changed selector, it will still select "Supper:

I have tried putting in a default value for the variable but makes no difference. I have uploaded the strict selector in my original post. Here is the code file

1 Like

Weird. This might mean also that the variable is not updating.
Can you add a log message/message box before the click to check what the Event_Value variable contains? that would be the only explanation i can think of.
if you can share the sample form, we would be able to test.

I used a write_line activity to check the value. It is “Afternoon”, but the robot does not click on the Afternoon option.

This works for me:

Hi @honghong

Please use this selector

<webctrl aria-role='radio' tag='DIV' aria-label='Brunch' />


Doesnt work. I am using studio X, which is my first time because normally I use studio

Could it be because of this? When i select override default value and confirm/save, and open again, the checkbox is unchecked.

Hi Anil_G, this doesnt work as well

Could be… Can you try without default value, and with override unchecked.

Update: Fixed it. I cleared the default value (dont think that is the issue though). Turns out my targeting methods was set to Fuzzy Selector and image. Switched it to strict selector and it worked. Thank you so much everyone