Page 1 of 1

Handling validation condition

Posted: Wed May 28, 2014 4:51 pm
by davilo61
Hi , I just started using ranorex yesterday and have a question on how to setup the logic to perform the following.

Consider the following flow:

1. Search for customer
Enter customer name in customer field
Search
2. a. If row returned , dblclick row
b. if no row returned, Click Close button and continue to iterate to next search value( return to step 1)

Does anyone have a code snippet to handle this type of flow which is probably a common flow?
Can this be handled by the validation function or does it need to be user code? What is the raborex best practice for handling this type of scenario ?

Re: Handing validation condition

Posted: Mon Jun 02, 2014 3:07 pm
by Support Team
Hi,

In order to be able to recommend a way to handle the described situation we need to know what you want to check. In what situation should the test be marked as passed and in what situation as failed?
Do you want to log if the row is empty respectively doesn't exist?
Should the test handle these two situations in the same way, so just by performing the further steps?
Do you prefer to write User Code or do you prefer to work with Recordings?

Regards,
Markus

Re: Handling validation condition

Posted: Wed Jun 04, 2014 2:34 pm
by davilo61
Hello,
I want to check simply for the existence of a row returned by a search. If no row is returned, I want to close window and continue search.

1. Search by identification number for example
1. Enter id number 12345
2. Search
3. Nothing returned
4. Close window and iteration to next number 12346 for example (repeat step 1)

I'm sure there are several methods to use but wanted to know the best practice. I would probably want to log the missing value using validation. Nothing returned for 12345 .

Re: Handling validation condition

Posted: Fri Jun 06, 2014 9:33 am
by Support Team
Hello,

When you know which id numbers to use I would just create a Test Case with a data source using the ids and a recording.
There you can for instance use an User Code action to distinguish whether a customer exists or not.
In generally you should design your tests without a logic since it is not so easy to read for others when you created condition based tests.
By the way what should happen when a row is returned?

Regards,
Markus