How to use Selenium IDE with tabular data and pagination?

136 views
Skip to first unread message

Bruno

unread,
Sep 30, 2009, 10:31:08 AM9/30/09
to selenium-users...@googlegroups.com
Hi

I used to record tests ion selenium IDE for after export in selenium/rspec formt to run all them with Selenium RC.

Now, I aquire a doubt when I was recording some test of crude operation of data in table with pagination.

For example, supose that I have a table of customers thats can show 10 itens per page and there nineteen customers
in this table.

When I record a test case for verify a creation of a new customer,  the new record created (for example the customer Barbosa) will be in the second page and at twentieth
position(last position) of the customers' table. For create a new customer this will be showing in the third page and at first position (pagination with 10 itens per page).

Ok, If I want test to view, edit or delete the twentieth customer (Barbosa)  I will need record this test clicking in the link for the second page of customers table
and there click in the link edit, view or delete at the twentieth element of a table. But if more customers are created and after this I run my test suite again
only operation that still works in my test is create a new customer, because view, edit and delete operations are linked with the fixed locations (page 2,  twentieth element)
and for crete a new customer the position of this element doesn't matter.For every test new customer created will be show in a new position in the table.

In this kind of situation, there a way for always test the complete CRUD operation in the same record, guaranteed?

Or I need to use another tool?


Thanks so much for any advice


Bruno Moura

Ara

unread,
Sep 30, 2009, 11:10:25 AM9/30/09
to selenium-users...@googlegroups.com
Hi Bruno,

First try to identify Number of pages using the following logic:

* <tr>\\ <td>store</td>\\ <td>23</td> OR <td>Locator to get Total Number of Records</td> \\ <td>recVar1</td>\\ </tr>\\ <tr>\\ <td>storeEval</td>\\ <td>Number(Math.ceil(${recVar1}/10))</td>\\ <td>recVar2</td>\\ </tr>\\ <tr>\\ <td>echo</td>\\ <td>${recVal2}</td>\\ <td></td>\\ </tr>

Execution Results Below:
* [info] Executing: |store | 23 | recVar1 |
* [info] Executing: |storeEval | Number(Math.ceil(${recVar1}/10)) | recVar2 |
* [info] Executing: |echo | ${recVal2} | |
* [info] echo: 3

So there are 3 pages.

Navigate to 3rd page and try to locate Newly added customer (to do Edit and Delete Ops).

Let me know if you have any questions.

Thanks,
Ara

Bruno

unread,
Oct 1, 2009, 7:42:06 AM10/1/09
to selenium-users...@googlegroups.com
Hi Ara!

Thanks so much for your help.

I'll change my tests to use your logic and so if I will have any problem
with this issue again I'll
post in this forum.

Thanks so much!

Hugs

Bruno Moura


2009/9/30 Ara <clear...@openqa.org>
Reply all
Reply to author
Forward
0 new messages