How to edit selector

I am performing a click activity within a loop. For each iteration, I am using a type into activity to type the value of my variable into a search field. Then, I need to click on the listed search result. However, there is an ID attached to each value in the result table. So, the click activity is only clicking on a single result for each iteration. Below is what my selector looks like:
**<webctrl aria-role='option' id='phraseIdDropdown:phraseId_1' tag='LI' />**

I am trying to edit my selector such that for each iteration, my selector will be
**<webctrl aria-role='option' id='phraseIdDropdown:phraseId_+id' tag='LI' />**
but this is not working.
Please, how do I go about this?

Try storing the part after id= into a variable, which will have 2 parts, the string ‚ÄúphraseIdDropdown:phraseId_‚ÄĚ and the incrementing counter. Then add it to the selector with {{}} like here

Like {{phraseIdDropdown:phraseId_}} + {{id}}, right?

Hi @Emmy_O ,

Use it like id=‚ÄėphraseIdDropdown:phraseId_{{id}}‚Äô

1 Like

What @ermanoj3101 said :slight_smile: the part you put inside {{}} is the variable, the part that is changing. The string ‚ÄúphraseIdDropdown:phraseId_‚ÄĚ is a constant in this selector.

1 Like

Thanks a lot @ermanoj3101! It works perfectly.

1 Like

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