is it possible to escape regex directly in Rxpath without the need of UserCode?
Scenario:
I get a value from a data source, which contains spaces and special characters like '(' or '/'.
This value needs to be selected in a dropdown control, but the dropdown item text is not equal to the value, but has leading and trailing spaces, so I cannot use
Code: Select all
@innertext=$myValue
Code: Select all
@innertext~$myValue
Example value 1:
Code: Select all
'ABC/DEF'
Code: Select all
'ABC\/DEF'
Example value 2:
Code: Select all
'ABC DEF'
Code: Select all
'ABC\ DEF'
Validating on AttributeContains is anyway too fuzzy, because there could be values like 'ABC DEF GHJ' which would result in a false positive.
I could escape the value, save in an additional variable just for the dropdown and use the original unescaped for validation, but this ends up in 2 variables for the same input field which seems messy to me.
If there was a possibility to directly escape in RxPath I could stick to only one variable and would have a clean solution then.
Any ideas?
Something similar was mentioned 9 years ago as request:
https://www.ranorex.info/request-xpath- ... 5050.html
but i do not know if this was implemented.