Variable in selector not working

selector
studio
variable

#1

I have created a web app automation project which contains many ‘click’ and ‘type into’ activities. and almost every activity’s selector contains title attribute. which may vary while moving that project into production environment. so i planned to set a string variable instead of static title value and implemented that as follows.

< h t m l t i t l e= ‘"+varName+"’ / >
(without the spaces in html title)

but its not working. Anyone please help me to solve this problem.


#2

(fyi , you can use “\” infront and it will show the < without the spaces) :stuck_out_tongue:

Please output the entire string in Message Box or Write Line to verify the selector is correct and matches what it would say with UiExplorer etc.

Then, you can use that string in the selector text box in properties.
Should be like this:
"<html title=’"+varName+"’ />"
including the outer quotations.

Regards.


#3

Thanks Clayton. I will try and let you know if its working or not.:smiley:


#4

@shankm
After modifying the selector, use it by dragging a new activity and paste the selector in selector region of properties.
Don’t indicate the element on screen.

Regards,
Mahesh