Check All Table Cell Values and CSS Classes with Selenium

Many applications contain tables.
Would it not be nice to have a way to check all table cell values automatically.
MyITest4U offers exactly this. In this article I will show you how to create a Test Generator which generates tests checking all the cell values of a table. You will see this can be done without any programming by the use of the Parent Tag Test Generator. The Parent Tag Test Generator needs a parent tag under which all the test relevant GUI elements are found. The parent tag in our case is the table tag.
Now we need all the tags which are test relevant. In our case these are the th and td tags.
In the example we will check the cell values of the following table .

l_linkTextTable

The creation of a Parent Tag Test Generator starts with a search for the parent tag. The GUI element search will show all the tables of your application. You can set a Speaking Name for every table. The speaking name will be used as part of the test name, which makes it easier to find a particular test.
Clicking on Generate Customized Tests will show the Prepend Test Name dialog. After selecting the appropriate values (in our case select all checkboxes) the Add Tag Template dialog is shown.
In this dialog you can select the tag, action and value which should be used in test generation. In our case these are:

Tag: th, td
Action: CheckText
Values: #CheckText#
l_addTagTemplateDialog

#CheckText# tells MyITest4U to use the value which was stored when the GUI elements of the table were collected.
You can give a name to the generator and save it for later use.
Clicking on Generate will generate the tests for all table of your application.

The created test generator can be used universally for any table. The created test generator is maintenance free as it uses only HTML standard. So in case there are any changes in the structure of a table a simple recollection of the GUI elements and a recreation of the test will incorporate all the changes in the test.

The example table uses different formatting for different table cells. The formatting is done by the use of different CSS classes. The CSS classes used for each cell can also be checked using a Parent Tag Test Generator. All you have to do is add the tag templates checking the CSS classes.

To ensure that the correct table cells are selected, you can simply highlight them with DrawHighlight.
The final Add Tag Template dialog looks like in the picture below.

l_addTagTemplateDialog2