Repo item wildcard?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
dmconsulting1
Posts: 169
Joined: Fri Nov 08, 2019 3:23 pm

Repo item wildcard?

Post by dmconsulting1 » Mon May 10, 2021 4:32 pm

//container[@controlname='platformNavigator1']/?/?/container[@controlname='cameraSelector1']/?/?/container[@controlname='toggleContainer']/radiobutton[@text='^Coarse']

Trying ^Coarse because the value changes from Coarse0 to Coarse1 depending on the state of the system. I don't care if 0 or 1, I just want Coarse (vs Fine). So I am trying to locate an item the STARTS with "Coarse" and thought the ^ was the way to do that. Seems I was wrong. Any other ideas? Thanks.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7469
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Repo item wildcard?

Post by odklizec » Mon May 10, 2021 5:06 pm

Hi,

Basically, you want to use regular expression in the xpath. For this you must change ‘=‘ to ‘~’, so the xpath should look like this…

Code: Select all

radiobutton[@text~'^Coarse']
Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

dmconsulting1
Posts: 169
Joined: Fri Nov 08, 2019 3:23 pm

Re: Repo item wildcard?

Post by dmconsulting1 » Mon May 10, 2021 5:36 pm

Ha, I was close.

Perfect, thanks a lot.