How to use formulas in the Data Table

You can use Microsoft Excel formulas in your Data Table of QTP. This enables you to create contextually relevant data during the test run session in QTP. You can also use formulas as part of a checkpoint to check that objects created on-the-fly (dynamically generated) or other variable objects in your Web page or application have the values you expect for a given context.

When you use formulas in a Data Table to compare values (generally in a checkpoint), the values you compare must be of the same type. When you extract values from different places in your applications using different functions, the values may not be of the same type. Although these values may look identical on the screen, a comparison of them will fail, since, for example 15.52 is not equal to “15.52″.

You can use the TEXT and VALUE functions to convert values from one type to another as follows:

  • TEXT(value, format) returns the textual equivalent of a numeric value in the specified format.
  • VALUE(string) returns the numeric value of a string.

If you are not much familiar with Microsoft Excel formulas, you may take help from Excel documentation. However, please note that the use of complex and nested formulas in the Data Table is not supported by QTP.

Rahnuma Tasnim

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top