I am trying to make it so that a variable that I am using is what the bot is able to read as part of the selector.
A quote number displayed in a table on a website links to the customer page when clicked. I’ve established that the bot can read the innertext of this and so I want to set the variable (pQuoteNumber) as a variable value as it will change each run.
I think I might have written this incorrectly, but can’t seem to get the right format; it just failed as a selector issue. Could anyone please tell me how the innertext section should look?
Blue lines are redacted customer info just FYI. Thank you!
If you right-click where you want your Variable/Argument to appear, you should have the option to insert it - The formatting will end up as: <webctrl tableCol='4' tag='TD' innertext='{{pQuoteNumber}}' />
Hope that makes sense - Please let me know if you have any questions.
Thanks in advance,
Josh
If your title is changing each time try removing title as a required part of the selector, or try simply replacing everything between the single quotes with an asterisk ie: title=‘*’/>
Hi again @dr1992,
Hmmmm, does your Variable/Argument have a Default Value?
You will receive an element could not be found, if that is left blank - While validating in isolation.
Maybe worth setting it, if you have not already.
Otherwise, as @postwick noted above, you will need to show us the regular Selector, so we can help to troubleshoot.
If you write quote number directly instead of passing variable then is it showing valid selector ?
If yes then above should work. And also hope you passed value to the variable before selecting the element. Can you please share the screenshot of the error message.
If you have already declared the variable and if it is having some values before using it in the selector. What you can do is , remove the portion the selector you want to replace with the variable and right click on the position which you removed and select the variable .
Thanks Josh; the pQuoteNumber is read from a JSON file, so it gets called upon as an object (which is pulling through).
I think that the issue might be that the innertext selector has white spaces afterwads, so like ‘123456/1WHITE SPACE’, is there a way I can use the {{pQuoteNumber}} to remove white space from the end?
Remove the data in selector between single quotes, right click and you can see choose variable option and select which variable you want to insert. After variable don’t include any *
Before you pass the variable to this selector or after reading from a JSON take assign activity
pQuoteNumber = pQuoteNumber.Trim
Also, just to check the selector is working go to the variable in the variables panel, and provide the default values(you can remove it later) as 123456/1