Unable to validate dynamic selector

Dear Robot Masters,

I am stuck at dynamic selector where I want to add dynamic row number. Agree, this is very common topic and workarounds available community but it didnt help.

Issue:

Variable Name - row_number
Varible Type - Int32

Tried below code so far -

[quote=“Uday132, post:1, topic:237798, full:true”]
Dear Robot Masters,

I am stuck at dynamic selector where I want to add dynamic row number. Agree, this is very common topic and workarounds available community but it didnt help.

Issue:

Variable Name - row_number
Varible Type - Int32

Tried below code so far -

<ctrl name='Row " + row_number.ToString + " ' role='row' />

<ctrl name='Row " + row_number.ToString() + " ' role='row' />

<ctrl name='Row* " + row_number.ToString + " ' role='row' />

<ctrl name='Row* " + row_number.ToString() + " ' role='row' />

<ctrl name='Row* {{row_number}}' role='row' />

<ctrl name='Row {{row_number}}' role='row' />

<ctrl name='Row* {{row_number.ToString}}' role='row' />

Any idea, what is wrong with my code?

Regards,
Yudi

Hi @Uday132,

It should be like the following.

"<ctrl name='Row " + row_number.ToString + " ' role='row' />"

Instead of

<ctrl name='Row " + row_number.ToString + " ' role='row' />

Note: It doesn’t matter whether the row_number is a string or integer

Warm Regards,
Ranjith Udayakumar

1 Like

Nope, it didn.t help. I don’t see the difference.

Actual Code -
<ctrl name='Row 0' role='row' />

Hi @Uday132,

Kindly share the static selector bot gives for the row 0.

Warm Regards,
Ranjith Udayakumar

Here you go.

image

1 Like

Instead of just replacing the value 0 alone, replace the entire attribute value with a variable like this
from
to

where str_row_number = "Row "+row_number.ToString

Kindly try this and let know for any queries or clarification

Cheers @Uday132

3 Likes

Hi Palaniyappan,

Thanks :slight_smile: It worked. But i am not sure what went wrong in original expression. Isn’t it possible to add text, space and dynamic selector in one go ?

Also, I would like to know how you will treat spaces and strings in between expression.

Eg. <ctrl name='Row 1 - character 12' role='row' />

And, I want to replace 1 by “A” and 12 by “B” variable (both are integer)

Regards, Yudi

1 Like

Same as we did above
This one I suggested because it will avoid the space problem and get the attribute value as a whole rather as parts
Cheers @Uday132

1 Like

Thanks a lot for your help!!!

No worries
@Uday132

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