Sponsored Ad

Monday, November 15, 2010

How to Check for parameter in DataTable in QTP Automation Testing

While using datatable in QTP you may want to check that the parameter exist in datatable or not. The below code will help you to find out the that given parameter exist or not.

Here dtGlobalSheet is data table and Param_Name is parameter name. once you run the  val=DataTable("Param_Name",dtGlobalSheet) statement you can check  if err.number <> 0 , it means error occurred due to previous statement running. and given parameter does not exist in datatable.

on error resume next
val=DataTable("Param_Name",dtGlobalSheet)
if err.number<> 0 then
'QTP: Datatable Parameter does not exist
else
'QTP: Datatable Parameter exists
end if

Hide warning from "Test results page" in QTP

While working with QTP Editor you may feel that you should suppress the warning message from test result page. To suppress Warning message follow the following instructions.

Step by step Procedure to suppress the Warning :

1. Go to Test Results Viewer.

2. Click in Tools.

3. Under the tools options, Click the filters.

4. Now unclick the warning checkbox.

Now no warning message will appear from test result page. This warning message will be suppressed for particular test only.

Show Line Numbers in QTP Editor

While coding with QTP, you may need to display line numbers in QTP Editor. Line number helps you to find the positions of particular line in Editor.

To enable line number in QTP just follow the below instructions:

1. Go to Tools in top menu of QTP.

2. Now from dropdown menu go to Editor Options.

3. Then go to General tab and set show line numbers check box

Tools -> Editor Options -> General tab -> set show line numbers check box

 

Related Software Testing Articles



Website List