UFT Developer | LeanFT Get Table Cell Values for all Rows of a Column

Validation of cell values of a table in the application under test is a common requirement as it is a very basic part of the functionality in regression testing. In this article, we will see how to get table cell values in LeanFT for all rows of a particular column and validate it. Here we will retrieve the values of the second column that is on the home page of the Mercury Tours demo application and validate that the price starts with the $ symbol.

The first column contains source and destination names and the second column contains the fair value.

LeanFT Table Validation

Example of LeanFT Get Table Cell Values

Code Explanation

To retrieve the specific cell value in LeanFT we can use the following syntax:

String sCellValue=tableobject.get(<Column Index>).getText();

The column indexing starts with one. In the above example, we are retrieving the text of the second column that is why an index 1 has been provided. Additionally, I have used another method startsWith() that checks the first character of the string return by the getText() method. Following this, you can write your own custom method that will return the cell value of a table by just providing a table object and column Index.

Recommended Posts

Leave a Reply