How to parametrize web index in selectors?

I have 3 checkboxes present on my screen and i have to check the boxes if the values in the excel column is Y.

The selectors for the first checkbox is as follows:


The selector for the second and third checkbox has webctrl idx as 2 and 3 respectively.

Can i pass a variable in the webctrl idx selector to determine which check-box to check based on which column in excel is Y.

It’s not really clear what you try to achieve. Can you post your files ?

Capture

The selector for the first checkbox is <html title='LA E&amp;E - Self Service Portal' />
<webctrl parentid='medBillsStartMonth' tag='SPAN' isleaf='1' idx='1' />

The selector for the second and third checkbox have the idx value as 2 and 3.

Can i pass a variable in the idx selector to determine which check-box to check based on which column in excel is Y.

You can achieve it by typing this into the selector input (be sure to type it into the box, do not open the selector window):
"<html title='LA E&amp;E - Self Service Portal' /><webctrl parentid='medBillsStartMonth' tag='SPAN' isleaf='1' idx='"+indexVariable+"' />"

The trick is to make a valid string out of the selector, so be sure to put the quote’s in the correct places. Then you concatenate the string with the variable, as you would do when you would concatenate any other strings.

Thanks a lot man… this worked :smiley:

1 Like