In Visual Studio 2010 there is a Generic Test type that allows you to integrate with automation tools like QTP. I have created a solution that allows you to use your existing QTP automation scripts within the Microsoft Visual Studio testing framework.
In Microsoft Visual Studio 2010 there is a Generic Test type that allows you to integrate with automation tools like QTP. I have created a solution that allows you to use your existing QTP automation scripts within the Microsoft Visual Studio testing framework and here's a sample below. The key part of this solution is transforming HP's QTP format to Microsoft’s Generic Test format so that you can publish the results to TFS. The added benefit of this integration is that you can also use TFS for bug tracking and more.
Prerequisite software - Visual Studio 2010 Premium or Visual Studio 2010 Ultimate and QTP 11
Run QTP_TFSGenericTest.exe
Extract QTP_TFSGenericTest folder to the C drive
The contents of the C:\QTP_TFSGenericTest folder look like below
QTPResults folder - This will store the QTP result files
QTPTFSGenericSolution folder - This is the VS Solution with the Generic Test
TFSGenericTestResults folder - This will store the transformed TFS Generic Test results file
QTP.vbs - This is the main script that will execute QTP and transform the results file.
Right-mouse click on the QTP.vbs file > select Edit
Replace the highlighted value below with the path of your QTP test
Save the QTP.vbs
Navigate to C:\QTP_TFSGenericTest\QTPTFSGenericSolution
Open the QTPTFSGenericSolution.sln(You will need Visual Studio 2010 to open this file)
Double-click the QTPTFS.Genericest
The Generic Test will open and you will see the following below
Navigate to the Test menu > Windows > Test View
Click on the Run button as highlighted below
You will then see the results of your Generic Test running a QTP script, in my case it Passed!