site
stats
By Anish Pillai Anish Pillai Posted under Advanced Concepts | Did You Know? | Not So Common Stuff

Did You Know: How QTP identifies Test Folders?

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

You would have probably used the Test Batch Runner tool to batch run your test scripts (If you are not aware of it, Test Batch Runner is a tool provided by QTP to run multiple tests in succession). In the Test Batch Runner tool, you need to click on the Add icon and then select the test folder to add it to the batch.

Test Batch Runner Tool


However, an important question that arises here is how does QTP identify that the folder we have selected is actually a test folder and not a normal one?

The answer to this is the question is the Test.tsp file available in the Test folder. When we try to open a test from the Test Batch Runner tool or from QTP itself, QTP tries to find out if the folder that we are opening contains the Test.tsp file or not. If the folder doesn’t contain the Test.tsp file QTP treats is as a normal folder. But if the folder contains Test.tsp file, QTP considers it as a Test folder.

Please note that only the file name Test.tsp decides whether a folder is a test folder or normal one. The contents inside the file doesn’t affect this decision.


Let’s see an example to understand this more clearly.

1) We have created a sample test case named ‘Sample Test’ which contains the Test.tsp file as shown in the below figure.

Test.tsp File


2) Open Test Batch Runner tool and add the ‘Sample Test’ to the Batch Runner tool. The test gets added to the tool as shown in the below figure.

Adding Test Folder to Test Batch Runner tool


3) Now delete the Test.tsp file from the ‘Sample Test’ folder. Try adding the test again in the Test Batch Runner tool. Now you’ll not be able to add the test case to the tool because this time QTP recognizes ‘Sample Test’ as a normal folder and not a test folder.


4) Create a new Dummy Folder. Open a new notepad file and save it as Test.tsp in the Dummy Folder as shown in the below figure.

Dummy Test with Test.tsp file


5) Try adding this Dummy Test to the Test Batch Run tool. You would notice the QTP identifies this dummy folder as a test folder and adds it successfully in the Batch Run tool as shown in the below image.

Dummy Test in Test Batch Run tool


The above example shows how QTP identifies test folders and differentiates them with the normal folders. Can you now use this information together with Windows Scripting, VBA and QTP AOM to create your own Test Batch Runner tool? Try it out and let us know how far you have reached.. :–)

If you enjoyed this article, you can join our blog to get new articles delivered directly in your inbox.

To check out QTP tutorials, visit our QTP Tutorials page. You can also check our Archives page to view the list of all our articles.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×