TryFindSingle or TryFindFirst - Feature : Bug Reports

TryFindSingle or TryFindFirst - Feature

Bug reports and feature requests.

TryFindSingle or TryFindFirst - Feature

Postby jainaakash » Thu Nov 18, 2010 7:59 am

Hi Ranorex Team,

I just realized that the TryFindSingle returns the first element found or false if no element is found.
I assumed the function to return false if it failed to find a single (unique) element and return TRUE ONLY if it finds a single(unique) element. So, for me this function is actually TryFindFirst and NOT TryFindSingle.

For example,
if we have two forms with names abc and abcd,
tryfindsingle - /form[@name~'abc.*']
will return true and will identify the first form found. This is not I would have expected from the method. The problem is I would not know in somecases, if the incorrect input was selected using tryfindsingle with regular expressions / wildcards.

Hope you understood my concern. Any inputs / thoughts are appreciated.
Let me know if you need more details.

Thanks and Regards,
Aakash
jainaakash
 
Posts: 48
Joined: Thu Jun 10, 2010 1:06 pm

Re: TryFindSingle or TryFindFirst - Feature

Postby artur_gadomski » Thu Nov 18, 2010 9:45 am

Isn't Find() what you're looking for? As I understand it returns a list of elements found. Then all you need to do is check if Count == 1.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark

Re: TryFindSingle or TryFindFirst - Feature

Postby jainaakash » Thu Nov 18, 2010 2:19 pm

Thats fine, I am able to get the list and check for what I want to look.
My actual concern / question is on the behaviour of TryFindSingle.
jainaakash
 
Posts: 48
Joined: Thu Jun 10, 2010 1:06 pm

Re: TryFindSingle or TryFindFirst - Feature

Postby Support Team » Thu Nov 18, 2010 4:52 pm

Hi,

TryFindSingle aborts the search when an element is found which fits to your RxPath. So it depends on the chosen RxPath to search for it. We cannot change this method to another name, because this would be a breaking change and many of our customers shout "Why you changed the name". To overcome this issue please use the solution from artur.

Regards,
Peter
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron