Incrementing names of UIelement

hello all

i have UIelement named: Person1, Person2 …, Person30
i’d like to click on them on the browser,
i created an int32 variable called Number =0 by default
in each loop, i assign Number=Number+1
i’d like to click on the UIelement named “Person”+Number.tostring
what should i write in Element in the Click option in orther to click on the UIelement i want??

Hi,

This is just a quick example.
What I will do is in the Selector box, delete the “<”, then select a different box. Now, click the Edit button next to the Selector box and that will bring up the Selector in the Expression Editor rather than the Selector Editor. Then, place the “<” back in.

You can also edit the string directly in the box without opening the editor.
When you’re good it will look something like this:
image

So, you can concatenate your selector string to include your variable.

I hope I was clear.

Regards.

thanks for your quick answer
but it did not work, i tried another way, in the selector
i have: <html app='firefox.exe' title='Tchatche - Bienvenue dans le chat' /> <webctrl aaname=' *' tag='A' idx='4' />
i’d like to replace the 4 with an int32 X variable but i can’t
could you help me please?

Can you paste the selector of Person1 and Person30 to make sure they have the same pattern and you are modifying the correct attribute.

On what basis you are looping your elements? If you know the # of elements which share the same selector pattern you can do foreach as below and modify your selector by passing
title=‘Person’+num.ToString or aaname=‘Person’+num.Tostring

For each num in Enumerable.Range(1, 30)
where element is an int type variable.

To know how to modify the selector, refer below link?

well thanks
i tried most of the syntaxes you said but it didn’t work
i’ll try to explain more specifically my problem by apploading screen shots
i feel more confortable working with flowcharts


then

then the selector

i’d like the idx=‘4’ in the selector to be replaced with the X as int32 variable
i tried several syntaxes but nothing seems to work, they say there’s a selector error when i try to run it
what should i do?
i hope i was clear enough, and i hope to get the right solution for my problem

1)What is the aaname value pattern?

2)What if you get rid of idx value in the selector in UiExplorer keeping aaname (Person*) and Tag ( in second line) and validate the selector? Is the Uiexplore validating it or throwing an error?

  1. Or idx=‘"+X.ToString+’"

there is no aaname
the aaname changes every time the selector changes
so the idx is the most accurate way to the right selector i found in my case
i just tried the syntaxe idx=‘“+X.tostring+”’ and it does not give me an error but it does not work, i think it doesn’t consider X as a variable. X from 1 to 30
i just seem not to have found the right sytaxe for idx=‘4’ where i replace the by my variable X
thanks for your help

Hey there,

Click in this box and edit the selector:
image

That way you are editing the selector as a string and can use variables.

It should look like this:

"<html app='firefox.exe' title='Tchatche - Bienvenue dans le chat' /><webctrl aaname='*' tag='A' idx='"+X.ToString+"' />"

You can also output that string in a message box if you would like to verify that the selector is correct before it uses it.

I hope this answers it for you.

Thanks.

thanks a lot
that was just what i needed