- Download/Unzip 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.GenericTest
- 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!
Each version of QTP will require a different transform file so if you would like more info, contact me directly.






Thanks for sharing.
ReplyDeleteIt's very useful for all.
QTPbook
Anna, Which version of QTP is this written for?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteAnna,i need the transform file for QTP 11 could you please provide
ReplyDeleteHi Anna,
ReplyDeleteGood to see this document and it is very useful, thanks a ton for this initiative.
I am having nearly 5 years of experience in QTP and very new to this tool TFS
Based on the request from our client we are planning to use TFS instead of QC.
We don’t have any clue to execute QTP scripts from TFS and store the results in TFS, Kindly help me in regard with this.
I have followed the steps mentioned above and QTP executed the test script successfully.
After closing QTP I am getting the following error on the screen
Windows Script Host
Script:C:\QTP_TFSGenericTest\QTP.vbs
Line:65
Char:1
Error:The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
Code:80004005
Source:msxml3.dll
Could you please tell me how to resolve this issue?I am using QTP 10.0 ,VS2010 Ultimate .
Some other Queries related to this topic.
1.Is it possible to checkin QTP script to TFS? I tried this but taking long time and VS going Not responding after some time.
2.Is it possible to execute QTP script saved in TFS, if yes how can we do this?
3.Right now all our scripts and supporting files are in QC,is it possible to export all these data to TFS?
4.Can you please explain me how the supporting files work which you provided in the QTP_TFSGenericTest.zip,if I change the location to H: instead of C:,will that be a problem?
5.Is it possible to execute the script in QC using the setup provided by you?
6.How to attach the supporting vbs files to QTP residing in TFS?
Thanks in Advance!!!!
Regards,
Renju
1. Yes it is possible to check-in QTP scripts into TFS.
ReplyDelete2. Yes it is possible to execute QTP scripts by checking the files out.
3. Yes it is possible for you to store your scripts and supporting files in TFS.
4. All the supporting files are declared at the top of the file, so if you change the location there won't be any problems.
5. I don't have access to QC, I created this using the Visual Studio framework to work with TFS.
6. The workspace will define where the TFS files are stored locally, so you can change the vbs file paths to point to the TFS workspace.
Anna
hi,
Deletegreat info, quick questions
1. is there a way to run multiple qtp scripts from a single generic test, in your great example only a single qtp script gets executed, what i want to know is if instead of providing a single qtp script to execute we provide a directory path with many scripts to execute, is this possible?
2. i'm not sure how do you upload the results to display in TFS portal, after you run the generic test we need to see the pass or fail result in TFS.
thanks,
oscar.velasco
Hi Oscar,
Delete1. You could create multiple generic tests that each point to a script. Another way you could do this is in QTP by creating a master test that references other tests.
2. You need to Publish your test results in order to see them in TFS.
Anna
Hi Anna,
ReplyDeleteGreat Work, Thanks a lot for guiding us . Few questions
1. Can you provide us the solution used for QTP 10.
2. Even in the solution you have provided, how do we upload the results in TFS , and how do we publish the results stating - How many test cases passed and how many failed in TFS.
Thanks
AK
Hi Anna
ReplyDeleteHow can I run more than one QTP test with above solution?
My requirement is like this:
1. Application Login (QTP Script)
2. Search on Application (Coded UI Script)
3. Application Logout (QTP Script)
It is very simple example and my requirement is combination of Coded UI and QTP Tests. It looks like for each QTP test I have to write separate QTP.VBS file from above solution.
Thanks
The Ghost
Hi Anna, Thanks alot for this great stuff. The only problem i am getting is an error message related to xml file format. Could you plz provide the desired xml file. The TFSGenericTestResults folder is empty in the zip file.
ReplyDeleteI am getting the following error on the screen
Windows Script Host
Script:C:\QTP_TFSGenericTest\QTP.vbs
Line:65
Char:1
Error:The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
Code:80004005
Source:msxml3.dll
Hi Rajender,
DeleteThis issue has been resolved with the latest version, please download the latest from here http://visualstudiogallery.msdn.microsoft.com/ef313348-8fd1-463b-9404-7472db99fda5
Thanks,
Anna
Hi Anna,
ReplyDeleteOn execution of the test from Visual studio, it says the test passed. But infact there is nothing getting executed, and QTP does not open for me.
Can you please help.
Chirag
Hi Chirag,
ReplyDeleteYou can test running the vbs from command line to see if QTP is opened.
Thanks,
Anna
I ran the vbs from a command line, but still QTP do not open.
DeleteI entered the following in the command prompt, Start /wait C:\QTP_TFSGenericTest\QTP.vbs.
I apperciate your response.
Do you have QTP installed?
DeleteHi Anna,
ReplyDeleteI didn't have any QTP related installation in my system and I have only the QTP scripts in .txt/.mts file format, will I be able to run these scripts using this.
Hi Vanisree,
DeleteIt is required to install QTP on your system, because it is called directly from command line.
Thanks,
Anna
Hi Anna,
ReplyDeleteI have both QTP and MTM environments in my system.
Once i run the QTP scripts and stores the results in TFS server, i don't want to maintain QTP environment as it is licensed.Is it possible?
My question is, after running the existing QTP scripts using this solution, can i remove the QTP environment so that i can create and maintain only MTM environment with MTM scripts.
Hi Vanisree,
DeleteThis is an integration with QTP so you will need QTP installed. You should look into CodedUI tests for automation because it works directly with TFS.
Hope that helps,
Anna
Anna,
ReplyDeleteWhat is the resolution for 2012?
Is there a partner that offers an integrated solution?
-MrHinsh
Hi Martin,
ReplyDeleteJust open the QTP TFS Generic Test solution with VS 2012 Premium or Ultimate and the integration works the same.
Thanks,
Anna