I need to perform data validation of two tables using Selenium.
Given a properly marked-up HTML table filled with data:
<table>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
And I want to "deserialize" this table (gather its data) into a bi-dimensional array (String[][]
) using Selenium. The reason I want to do so is that I have another HTML table (on the other web-page) that contains supposedly the same data stored in it - and I need to perform data validation between those two tables.
I have tried lots of options on how to solve this problem, and iterative cell-by-cell data gathering (locating cells either using the getTable() or getText() methods) is not one of them - since it takes enormous amounts of time to complete a big table on an overloaded web-page.
JavaScript injection (using the getEval() method) is not available in my case since the table resides in an <iframe> that has an origin (base URL) that differs from the one of the main page. And according to same origin policy this cannot be performed.
Guys, any idea on how to solve the given problem?