Selectors as variable

Hi,

any suggestions how to store this selector pattern in variable

<webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl04_ddlGroupCurStatus’ tag=‘SELECT’
<webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl06_ddlGroupCurStatus’ tag=‘SELECT’
<webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl08_ddlGroupCurStatus’ tag=‘SELECT’
<webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl10_ddlGroupCurStatus’ tag=‘SELECT’
<webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl12_ddlGroupCurStatus’ tag=‘SELECT’

P.s: so here ctl04,ctl06… changing .

I assigned count value as 2 and then assign to count=count+2
and i store selector varible like this format:

selector=" <webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl0"& count2 & "_ddlGroupCurStatus’ tag=‘SELECT’ "

but it gives value like ctl04,ctl06,ctl08 but not following next pattern…(it gives ctl010 but I want ctl10)

Hi @chiranjit.saha1,

Please use this selector,

selector=" <webctrl id=‘ctl00_c1_gvReconStatus_ctl01_ctl"& strCount & "_ddlGroupCurStatus’ tag=‘SELECT’ "

Assign:

strCount = intCount.ToString.PadLeft(2, CChar(“0”))

Sample Workflow:

selectorVariable.xaml (5.4 KB)

Thanks!

1 Like

Many Thanks, It worked.
btw what is the function of PadLeft(2, CChar(“0”)) ?

Thanks!