rajiv_mnit
(Rajiv garg)
November 6, 2017, 9:06am
1
Hi Team
I have this locator
html title=‘* ~ Salesforce - Unlimited Edition’ />
<webctrl aaname=‘Sooria Narayanan45’ parentid=‘Contact_body’ tag=‘A’ /
It works fine as an individual but I need aaname to be replaced with a variable
I tried
html title=‘* ~ Salesforce - Unlimited Edition’ />
webctrl aaname=‘“+Variable.ToString+”’ parentid=‘Contact_body’ tag=‘A’ />
but its not working.
Can someone please help me on this.
ddpadil
(Dilip)
November 6, 2017, 9:10am
2
Hi,
Don’t open selector editor just pass in minimized property like this:
"<html title=’* ~ Salesforce - Unlimited Edition’ /> webctrl aaname=’"+Variable.ToString+"’ parentid=‘Contact_body’ tag=‘A’ />"
In double quote and single line
palindrome
(Nitin Safaya)
November 6, 2017, 9:25am
3
Try this:
Store the selector string in a variable with value of dynamic attribute as any dummy default text.
Example:
string selector = “< html title=’* ~ Salesforce - Unlimited Edition’ /> < webctrl aaname=‘#name # ’ parentid=‘Contact_body’ tag=‘A’ />”
Replace dynamic value with actual variable.
selector = selector.Replace(“#name #”,PersonName)
Pass this selector variable to the activity’s selector textbox.
rajiv_mnit
(Rajiv garg)
November 6, 2017, 9:42am
4
Amazing Thanks Mr.ddpadil. I tried for 8 hours with all combination but it did’t work.
But this is now working. Thanks a lot. However when making this selector in editable mode it was throwing an error.
Cna you please explain
rajiv_mnit
(Rajiv garg)
November 6, 2017, 9:44am
5
Sorry Palindrome , not able to understand how to use this techinique.
Can you please explain step by step so that other people can take advantage of this techinique
palindrome
(Nitin Safaya)
November 6, 2017, 10:01am
6
What I mean is that you can use Assign activity to store selector string in a string Variable then you can replace the attribute aaname value (which is some random word set by you) with actual values. This can be done using assign activity:
selector = selector.Replace(“#name #”,Variable)
Now if Variable is have new name that is required as aaname’s value.
OLD string:
string selector = “< html title=’* ~ Salesforce - Unlimited Edition’ /> < webctrl aaname=‘#name #’ parentid=‘Contact_body’ tag=‘A’ />”
After Replace:
string selector = “< html title=’* ~ Salesforce - Unlimited Edition’ /> < webctrl aaname=‘John Deo’ parentid=‘Contact_body’ tag=‘A’ />”
You can directly put variable name in minimized property of selector.
ddpadil
(Dilip)
November 6, 2017, 10:05am
7
Yep its known minor issue.Will be fixed in coming days
rajiv_mnit
(Rajiv garg)
November 6, 2017, 10:21am
8
Thanks ddpadil you have been a great help always.