Variables inside selector

Hi,

I’ve got selector like this:

image

Two last rows are reference to Row and Item in table.

I need to ‘get text’ from n-position.

I’ve made While loop. Inside of it there is ‘get text’ (selector above) that extract text from specific cell. I noticed that ctrl name=‘Wiersz 1’ role=‘row’ and ctrl name=‘Korekta row 0’ role=‘cell’ are changing for example: ‘Wiersz 1’ , ‘Korekta row 0’ is the first cell, second is ‘Wiersz 2’ and ‘Korekta row 1’ I’ve made two variables inside loop and while processing the loop int_Wiersz and int_Pozycja. Those vars are incremted through loop and then converted to string. I need to pass those variables inside the selector forcing whole ‘get text’ activity to move on next cells inside table.

How can I pass those two variables insine selector?

I’ve tried something like this but this is not working.
ctrl name='Wiersz '+ str_Wiersz+ role=‘row’
ctrl name='Korekta row '+ str_Pozycja+ role=‘cell’

Regards,
Aleksander

Hi @Alko - Try the below mentioned one.

ctrl name='Wiersz + str_Wiersz+ ’ role=‘row’
ctrl name='Korekta row + str_Pozycja+ ’ role=‘cell’

And give the whole selector in one single line inside " " also use <> respectively

Thanks,
AK

Hi
Kindly have a view on this once buddy

Cheers @Alko

@Alko

Try this:

ctrl name='Wiersz “+str_Wiersz.Tostring+” ’ role=‘row’
ctrl name='Korekta row “+str_Pozycja.Tostring+” ’ role=‘cell’

I tried @Palaniyappan soultion, I’ve got this dropdown menu with variables but when robot approach to this activity it stopping whole execution.

Fine
may i know did that give you any error or it got stopped abruptly buddy
kindly run once in debug mode and check with the error that occured
Cheers @Alko

I’ve got this:
image

Whole exception:
UiPath.Ipc.RemoteException wrapping UiPath.Core.InvalidSelectorException at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

1 Like

Fine @Alko
I think this error occurs due to get text activity with which we are trying to get the string from the screen…can i have a view on the selector once if possible
Cheers @Alko

@Palaniyappan

Yes, of course;

"<wnd app='comarch opt!ma.exe' ctrlname='MainView' /><wnd ctrlname='VAT7ListaView' idx='1' /><wnd ctrlname='uxMainTabControl' /><wnd ctrlname='uxPageVat7' /><wnd ctrlname='uxList' /><ctrl name='uxList' role='table' /><ctrl name='Panel danych' role='client' /><ctrl name='Wiersz " + str_Wiersz+" ’ role='row' /><ctrl name='Korekta row "+ str_Pozycja+"’ role='cell' />"

312 position is between last < and ctrl

fine mention this @Alko
ctrl name=’*"+ str_Pozycja +"’
i have a doubt is that the target element you can check at the bottom left of the selector editor where we will be having a small box with Target Element specified in it…check with that buddy
Cheers @Alko

@Palaniyappan well, UiExplorer shows me that when is something typed in cel it adds ‘text’ attribute.

1 Like

Fantastic
so the number gets dynamic, i hope thats what you were actually trying to replace with a variable…
Cheers @Alko

@Palaniyappan Yes, It gets dynamic and that exactly what I trying to achieve.

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