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??
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:
So, you can concatenate your selector string to include your variable.
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?
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
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