How to get all rows from a dynamic table using selenium with Perl.

143 views
Skip to first unread message

Yuva

unread,
Feb 17, 2014, 7:48:45 AM2/17/14
to seleniu...@googlegroups.com
How to get all rows from a dynamic table using selenium with Perl 

in table 20 column are available & rows are populated on running time 

need to know 
1.how to get all values from table
2.how to store all values & comparing to another values
3.find the time difference between first column  & rows values via perl

table id is :
==============
$sel->click_ok ("id=table")
first table (column with row) values follows :
==================================
$sel->table_is("css=table.1.0" ,"Jan 20,2013 4:00 PM")
$sel->table_is("css=table.2.0" ,"Jan 20,2013 4:30 PM")
$sel->table_is("css=table.3.0" ,"Jan 20,2013 5:00 PM")
$sel->table_is("css=table.4.0" ,"Jan 20,2013 5:30 PM")
$sel->table_is("css=table.5.0" ,"Jan 20,2013 6:45 PM")
$sel->table_is("css=table.6.0" ,"Jan 20,2013 6:55 PM")
$sel->table_is("css=table.7.0" ,"Jan 20,2013 7:20 PM")
etc..................
all table (column with row) values follows
==================================
$sel->table_is("css=table.1.0" ,"Jan 20,2013 4:00 PM")
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.1", "10");
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.2", "20");
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.3", "30");
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.4", "40");
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.5", "50");
$sel->table_is("//div[\@id='table']/table/tbody/tr/td[2]/div/table.0.6", "60");
$sel->table_is("css=table.2.0" ,"Jan 20,2013 4:30 PM")
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.1", "10");
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.2", "20");
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.3", "30");
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.4", "40");
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.5", "50");
$sel->table_is("//div[\@id='table']/table/tbody/tr[2]/td[2]/div/table.0.6", "60");
$sel->table_is("css=table.3.0" ,"Jan 20,2013 5:00 PM")
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.1", "10");
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.2", "20");
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.3", "30");
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.4", "40");
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.5", "50");
$sel->table_is("//div[\@id='table']/table/tbody/tr[3]/td[2]/div/table.0.6", "60");
etc..................

Please let me know the solution ASAP

Thanks a lot in advance
Yuva

Yuva

unread,
Feb 18, 2014, 1:05:35 AM2/18/14
to seleniu...@googlegroups.com
Hi Selenium Perl Users,

Could u please provide solution for this

Thanks,
yuva

Yuva

unread,
Feb 19, 2014, 1:47:05 AM2/19/14
to seleniu...@googlegroups.com
Hi Selenium Perl Users,

Could u please provide solution for this.It is urgent

Thanks,
yuva

Sundeep Gupta

unread,
Feb 19, 2014, 2:07:57 AM2/19/14
to seleniu...@googlegroups.com
What is the selenium issue here ?

As I understand here, you have a table which is dynamically populated. You are trying to read the table cell values and store it for later part of your test (comparing or anything else).
You can use the loops, arrays for iterating through the table cells and storing the values.

Coming to the 'dynamic' part of the table. Please clarify more on this.
In general, the 'dynamic' behavior would be deterministic, say table getting refreshed every 10 seconds or on a particular event. And if it is deterministic, you can write your test according to those conditions.
And if there is someway in your product to disable the auto-update of the table, you can do that as well (if it is possible).

- Sundeep 

Yuva

unread,
Feb 19, 2014, 6:46:43 AM2/19/14
to seleniu...@googlegroups.com
thanks Sundeep for your reply.

i am new to the Selenium & Perl. So i need Perl Program with selenium to read /compare the values in Table.
My table is refreshed every 30 minutes

So Please provide a Perl Program with Selenium to achieve above condition

Thanks in advance,
yuva 

Sundeep Gupta

unread,
Feb 19, 2014, 7:49:34 AM2/19/14
to seleniu...@googlegroups.com
Hi Yuva,

Here are some good links to get you started on perl. 


Thanks,
Sundeep

On Monday, February 17, 2014 6:18:45 PM UTC+5:30, Yuva wrote:
Reply all
Reply to author
Forward
0 new messages