Regular Expression

Ask general questions here.
thirukumar
Posts: 8
Joined: Tue Jun 07, 2016 8:30 am

Regular Expression

Post by thirukumar » Tue Jun 07, 2016 10:49 am

/form[@title='Equipment Operators']

/form[@title~'^Shift\ Change\ -\ Cat\ MineSt']

My answer for above by using regular expression
1) /form[@title~'*.*']
2) /form[@title~(=|~)'*.*']
3) /form[@title~(=|~)'*.*']
4) /form[@title*]
5) /form[@title*.*]

All failed. Any Suggestion on this how to use regular expression.

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

Re: Regular Expression

Post by odklizec » Wed Jun 08, 2016 12:49 pm

Hi,

Matching form with "any" title is not a very good idea (if this is what you are after). You see, this could take a very long time to find all forms and it may return many irrelevant forms!

If your application can have either of both titles, then use OR operator in you xpath, like this:

Code: Select all

/form[@title='Equipment Operators' or @title~'^Shift\ Change\ -\ Cat\ MineSt']
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

thirukumar
Posts: 8
Joined: Tue Jun 07, 2016 8:30 am

Re: Regular Expression

Post by thirukumar » Wed Jul 06, 2016 12:38 pm

Thank You Odklizec. It worked with your idea.


Thanks.