How to pass variables in selectors

selector
studio
variable

#1

Hello ,

Could you please guide me on how to pass variables in selectors


How to use a variable in: <webctrl aaname=VARIABLE />
Variables in selectors
セレクタに変数を使用する
@Select item is not working
How to use variables in data Scraping
#2

Hello!

You have to pass the entire selector through a variable (String) and modify what you need on that variable.

To be clear, I’m attaching a Example of how do that.

Any doubts, please let me know.

Regards,

SelectorVariable_Example.xaml (7.3 KB)

PS - On the example I’m typing “Hello World” in a Notepad.


#3

Thank you…It worked


#4

Hi Lucas,

when i try to replicate the same scenario, i am facing a selector issue.

this is the selector i founded in my work flow,

the selector in the work flow you shared is

why the difference, how could you achieve this selector .

Please, let me know .

Thanks in advance.


#5

Hello!

I just passed the selector value as a String on selectorContent variable.

:slight_smile:


#6

Do you have any idea, why selector is different ?


#7

I am also facing the same problem. I am trying to use a counter and assign it to Selector
Actual element Selector:
image

Trying to dynamically assign ‘tableRow’, as;
image

But this does not work :frowning:
It does not find the element…
How do I fix it?


#8

Hey @BuddingCoder

Use i.Tostring() .

Regards…!!
Aksh


#9

Thanks, but it does not find the element.

I have added a check to see if such an element exist and it fails everytime (while using ‘i’).
The same thing if I try to replace with exact number, the script runs successfully and the check return true.


#10

check the selecters try to debug or use UIexplorer.


#11

Ok, will try that…


#14

in the above given seletor Can someone help us how to increment the table row using the variable.


#15

Even I am facing the same issue, though I enter the variable name in quotes as ’ “+day” ’ it gets converted to webctrl aaname=’& quot;+day& quot;’ after I run my workflow.

How to escape double quotes(") in the selector? Or am I missing something else?

Please help


#16

Hi @Shiny,
use like this
<webctrl aaname='"+day.ToString()+"' />

Regards,
Arivu


#17

I have followed SelectorVariable_Example.xaml however I encounter error below.

Can someone please advice on this?

Thanks.


#18

Hi, Lucas.

I apply the same logic of your example to my case and I get this error

My selector is this

“<webctrl tableCol=‘8’ tableRow=” & pRowCounter.ToString & “tag=‘INPUT’ />”

If someone can help, please.

Thanks


#19

Hi @aedsferrao,

use this one
"<webctrl tableCol='8' tableRow='"+pRowCounter.ToString+"' tag='INPUT' />"

Regards,
Arivu


#20

@arivu96

Thanks I forgot to put apostrophes in tableRow.

Works fine now :smiley:


#21

Hi,
<webctrl aaname=’"+day.ToString()+"’ parentid=‘drawerMiniMonthNavigator’ tag=’
I already used ’ “+day.ToString” ’ but it just didn’t work out. I use google calender so i don’t know this fail just appear on gg calender or not.

Thanks


#22

hi this video help you to understand dynamic selectors


How to pass a Data Scraping Variable (Out) in other Variable