Hello All! In this post we are going to see how to execute VBS files in QTP. Before getting started, VBS is a VBScript file contains block of VBscript that will be used by QTP Tests. In most cases, we will be having the user defined functions and global variables in VBS files.
There are two ways by which we can execute VBS files using QTP. One simple way is that add the VBS files to the resources list of the test. By doing so, all the VBS files assicated as resources will be executed when we start the QTP Test execution.
To Add VBS to Resources:
1. Select File - > Settings
2. In Test Settings dialog, select 'Resources' tab.
3. Click on the "+" symbol and add the VBS files to resources.
The second method is "ExecuteFile" function.
Syntax:
ExecuteFile "<VBS File Name with Path>"
Ex:
ExecuteFile "C:\Test.VBS"
We can use ExecuteFile method to load a VBS file during run time. Where as the first method will be used to execute the VBS files when the QTP Script execution starts.
No comments:
Post a Comment