So maybe the title doesn't express my need but i will describe it here.
I use ranorex api in a visual studio project.
Now i have a element which is a hardcoded string except a number: text[@automationdid='Phone1'], number 1 is a number that can change.
Can I search in a element for a partial path like text[@automationid='PhoneX'] without giving the x?
Getting the xpath of an element knowing its partial automationid
-
- Posts: 1
- Joined: Fri May 24, 2019 11:59 am
Re: Getting the xpath of an element knowing its partial automationid
Hi,
sure, it is possible.
Ranorex Path can be used as regular expression.
In you case you can use next rxPath:
text[@automationid~’Phone[0-9]’] -> test will look for Text element with automationid Phone0, Phone1,...,Phone9
or you can use this:
text[@automationid~’Phone’] -> test will look for Text element with automationid which contains "Phone".
All info for rxPath you can check by link below:
https://www.ranorex.com/help/latest/ran ... th-syntax/
https://www.ranorex.com/help/latest/ran ... ex-syntax/
sure, it is possible.
Ranorex Path can be used as regular expression.
In you case you can use next rxPath:
text[@automationid~’Phone[0-9]’] -> test will look for Text element with automationid Phone0, Phone1,...,Phone9
or you can use this:
text[@automationid~’Phone’] -> test will look for Text element with automationid which contains "Phone".
All info for rxPath you can check by link below:
https://www.ranorex.com/help/latest/ran ... th-syntax/
https://www.ranorex.com/help/latest/ran ... ex-syntax/