How to handle Web Tables

What is Web Tables?

A Web table is a collection of rows and columns. For a Web table, data is stored in cells. Tables are used not only in data sheets but also in organizing web pages.

A Web table normally contains the following tags:

  • table – indicates a table.
  • tbody – defines a container for rows and columns.
  • tr – specifies a row in the table.
  • td / th – table data/table header indicating columns in respective table rows.

A basic web table

basic web table

A basic web table’s HTML code looks like below:

web table html

Handling Web tables is perhaps much more complicated than any other elements or controls. This article will show you how to handle web tables using Katalon Studio.

Handle web tables with Katalon Studio

Example 1You want to get a text from a Web table and verify it.

Scenario:  Let’s say we need to find out which country the ‘Pay talk’ company in the above table belongs to.

First of all, we will find the location of table then we will store all table elements in the list. Next, we will run a loop and iterate through each row and column and capture the value in each cell.

Script Mode:

 

Manual Mode:

Switch to manual mode tab to view test case step by step.

 Handle-webtable

Example 2: You want to perform actions on the Web table below

Web-table

Scenario: 

Let’s say we need to edit a student record that has the graduation year of 2018

Script Mode:

Manual Mode:

Switch to manual mode tab to view test case step by step.

Handle-webtable-2

Examples above provide a basic understanding on how to handle web tables in Katalon Studio. If you are new to automation testing, it is recommended to take advantage of Manual Mode in Katalon Studio. For advanced testers, Script Mode provides you flexibility in creating and manipulating tests. Please download the source code here.

For further instructions and help, please refer to Katalon Studio Tutorials and Katalon Forum.

82% people found this helpful
Related testing tools
Katalon Studio
Best automation solution for software testing team. Completely free!
Katalon Recorder
Ultimate Selenium IDE to record, play, and debug app. Fast and extensible!
Katalon Analytics
Bring you to the next level of test execution reports. Smart and seamless solution!
Scroll up