Page 1 of 1

RegEx

Posted: Fri Mar 06, 2015 3:09 am
by Styris
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 ?

Re: RegEx

Posted: Sat Mar 07, 2015 1:05 am
by Styris
anyone ?

Re: RegEx

Posted: Sat Mar 07, 2015 7:49 am
by odklizec
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.

Re: RegEx

Posted: Mon Mar 09, 2015 10:50 pm
by Styris
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 ?

Re: RegEx

Posted: Tue Mar 10, 2015 6:43 am
by odklizec
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.