I’m using find children to get the Ui Elements from a dropdown, after which I use get atributes to get the innertext.
But there is a bit of an issue, the innertext is returned as “Practice - Lab - Medical”
Output: “Practice - Lab - Medical”
Expected: “Practice - Lab - Medical”
In output there is extra space before Lab and Medical, I want to remove that extra space
I want to one shown in expected value, as it is the one present in the dropdown.
Any help is much appreciated, thanks.
After using the “Get Attributes” activity to retrieve the “innertext”, add an “Assign” activity to store the retrieved value in a string variable. Let’s assume you have a variable called innerTextValue to store the value.
Add another “Assign” activity to trim the innerTextValue. Set the following expression:
It will delete all spaces which are available before and after hypon. Its generic one when you don’t know how many number of spaces are Coming. Simple replace handle only when you know the number of spaces and its fixed for all cases.
In replace in first double quotes give the double space and in second double quotes give single space.
When you use this it will replace the double space to single space.