RegEx

Mobile Testing, Android App Testing.
Styris
Posts: 49
Joined: Tue Feb 03, 2015 2:32 am

RegEx

Post by Styris » Fri Mar 06, 2015 3:09 am

I have a confusion on how to apply RegEx.

I know in the Ranorex UI I can do a AttributeRegEx with match name as Text, and match value as [a-zA-Z0-9 ]+ but can I also just go to the xpath and put that regualar expression there.

So do I need to do it bboth places or just one. If one, then which one ?

Styris
Posts: 49
Joined: Tue Feb 03, 2015 2:32 am

Re: RegEx

Post by Styris » Sat Mar 07, 2015 1:05 am

anyone ?

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

Re: RegEx

Post by odklizec » Sat Mar 07, 2015 7:49 am

Hi,

Regex in xpath is used for identification of the element in question (to help Ranorex with unique identification of the element). Regex in AttributeRegEx is used for matching certain attribute of the element identified by xpath. It's completely up to you where and why you use regex. Please try to explain in more details what exactly you want to achieve using regex.
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

Styris
Posts: 49
Joined: Tue Feb 03, 2015 2:32 am

Re: RegEx

Post by Styris » Mon Mar 09, 2015 10:50 pm

I was trying to validate a Roster list (we have a messaging app) where a bunch of different users sent me messages. I wanted to be able to search for any X user (say, User "John Doe"). So in the test should I put an attributeequal or attributeregex ? or should I just change the repo item to a regex ?

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

Re: RegEx

Post by odklizec » Tue Mar 10, 2015 6:43 am

Hi,

I guess it should be just enough to use attributeequal for this particular case. However, it's hard to help you without seeing the application or at least its snapshot. Please create a snapshot and post it here.
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