Random names

Ranorex Spy, Recorder, and Studio.
colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Random names

Post by colutti » Mon Nov 26, 2012 6:53 pm

Hello

We have automated an test case that adds a "person" to our application. How do I do to use an external source, like Excel, so every run of this test adds an random or sequential person read from this external source?

I need that because the application being tested does not accept 2 equals names and I dont want to think about what other person I have already added to the application on previously tests.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Random names

Post by Ciege » Mon Nov 26, 2012 8:44 pm

You need to read up on the User Guide. See Data Driven Testing...
http://www.ranorex.com/support/user-gui ... sting.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Random names

Post by colutti » Mon Nov 26, 2012 9:28 pm

The user guide does not cover what I want to do. I know how to add a Datasource and bind it to a var. But when I do that it will execute the test for every line on my excel file and that is not what I want. I want to execute the test only once. I know I could set a interval for every test, but this is the same of just typing a different name on each test. Let me explain it better:

3 test cases

1 - Add a person
2 - Add a person with invoice
3 - Add a person with 10 invoices

Each of those tests adds a person, but for every test I want to add a different person reading the names from a excel file sequentially.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Random names

Post by Ciege » Mon Nov 26, 2012 10:34 pm

Well, personally I do not use the dataconnector. Rather I interact with my Excel files myself through Interop.
So I think you will need the support team to jump in here to help with this one then.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Random names

Post by Support Team » Tue Nov 27, 2012 12:16 pm

Hello,

You can add the data connector to each of your testcases. In each data source of the different test cases you can define a different data range.
E.g. You have a data source with three names in it. For the first test case you can set the data range to 'From 1 to 1'
If you do so, the test case will only be executed once with the first row of your data source.
In the second test case you can set the data range to 'From 2 to 2' and so on.
DataSource.png
DataSource.png (35.02 KiB) Viewed 1210 times
TestSuite.png
TestSuite.png (55.64 KiB) Viewed 1210 times
I hope I could help!

Regards,
Bernhard
.
Image

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Random names

Post by colutti » Tue Nov 27, 2012 2:15 pm

OK, but its the same work I would have if I just set the name.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Random names

Post by Support Team » Wed Nov 28, 2012 9:11 am

Hello,

Yes, but the advantage is that you only have to change one file if you want to modify the names.

Regards,
Bernhard
.
Image