# Compare two tables using SeleniumLibrary

**URL:** <https://forum.robotframework.org/t/compare-two-tables-using-seleniumlibrary/1570>\
**Category:** Robot Framework\
**Created:** [31 March 2021 16:32 UTC](https://forum.robotframework.org/t/compare-two-tables-using-seleniumlibrary/1570 "2021-03-31T16:32:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anilreddy](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@anilreddy](https://forum.robotframework.org/u/anilreddy)\
**Post date:** [31 March 2021 16:32 UTC](https://forum.robotframework.org/t/compare-two-tables-using-seleniumlibrary/1570/1 "2021-03-31T16:32:55Z")

</div>

Hi,

I need a way to compare two tables containing similar details using Selenium Library. For example I have table like below:

[https://www.w3schools.com/html/html\_tables.asp](https://www.w3schools.com/html/html_tables.asp)  
In the above table there are headers and columns I need to first convert them into maps like this

Country is key and values are like below:

{ “Country”: “Germany”, “Mexico”, “Austria”, etc., }

Is there a keyword for it?  
and then compare both tables like maps.

Can you please tell me a way.

Thanks,  
Anil Gaddam

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [1 April 2021 09:32 UTC](https://forum.robotframework.org/t/compare-two-tables-using-seleniumlibrary/1570/2 "2021-04-01T09:32:00Z")

</div>

Hi Anil,

As far as I know there is not a library that handles tables in web pages [see this post for why](https://groups.google.com/g/robotframework-users/c/db-VFK7Bo1M/m/c8Cs61MMAwAJ).

In addition to that your “map”? structure doesn’t appear to be a standard structure so robot framework would have trouble comparing it in a way that you might expect

Instead of:  
`{ “Country”: “Germany”, “Mexico”, “Austria”}`

A more standard structure like this will probably give you better results:  
`{ “Country”: [“Germany”, “Mexico”, “Austria”]}`

But you will probably need to build your own keyword that pulls the data from the table in your application into that structure.

If your really lucky though, and this will depend on how your app is written, some web applications pull data from a webservice end point that returns the table data in XML or JSON, so a simple call to the end point may return the data XML or JSON which there are robot framework libraries for and this will save you a heap of time if that is the case.

Dave.
