Home » Basics

How to use formulas in the Data Table

28 October 2009 1,207 views No Comment

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.

Popularity: 7% [?]

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.