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.
(fyi , you can use “\” infront and it will show the < without the spaces)
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.
@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.
I would probably use a Regex pattern, like this one "[^\w\d]+"
Then, you can use .Match or .Replace Regex.Match(str, pattern).Success
or Regex.Replace(str, pattern, "")