How to Get Table Cell Value in LeanFT | UFT Developer

Validating the content of web table values is a very common requirement in automation testing. If you have ever used UFT, you might be aware that it has an inbuilt function GetCellData() to retrieve table cell values where we can simply pass the desired row and column value and it returns the value for that specific cell. However, there is no such inbuilt method available in UFT Developer formerly known as LeanFT but this does not stop us to validate the content of the web table.

In this article, we will see how we can create our custom GetCellData() method to get table cell value in LeanFT for the required row and column of a table whether it is a web table or a table built on any other technology. We will also learn how to get table Column Headers in LeanFT (UFT Developer).

Get Table Cell Value in LeanFT or UFT Developer

First of all, we will create a class named CommonMethods and inside it, we will define the GetCellData method. This method has four arguments. The first one is the browser object, the second one is the table object, the third one is the row number and the last one is the column number.

Example-Get Table Cell Value in LeanFT

Now create a test with the class name GetTableCellValue and call theĀ GetCellData method in it. In this example, I am retrieving cell values for the fourth row and second column.

How to Get Table Column Headers in LeanFT | UFT Developer

There might be instances wherein you may need to get column names of a table to validate them.

The following example shows how to retrieve column headers using LeanFT.

Recommended Posts

Leave a Reply