To enable Quicktest Pro to access the XML based repository, the steps to be followed are:-
Download the DOR Parser and run the set up executable. The setup program prompts you with instructions. It is recommended that you follow the default options suggested by the installer. Note :- If you are planning to install the XML Repository Manager, you don’t have to install the DOR Parser separately. In the Repository Manager installation, choose full install to install both the Repository Manager and the DOR Parser.
After installing, you should see a directory structure similar to the following <Install_Dir>--| |- docs |- lib |- sample ---| |- quicktestscript |- vbscript |- webpages |- xmlrepository
Note :- If you have installed the DOR Parser as a part of the XML Repository Manager, then the <Install_Dir> mentioned above is to be replaced by <XML Repository Manager Install_Dir>\DORParser
In the <Install_Dir>\sample\vbscript directory, there is a sole vbscript function(DescOR.vbs) which acts as the gateway between Quicktest and the Descriptive Repository library. Make sure that this script becomes one of the scripts that gets loaded when Quicktest starts. You can set the start-up functions from the Tools-Options-Resources tab in Quicktest. For existing tests, you can modify the resources from the Test-settings-resources tab. If you already have some utility scripts and don’t want to add a new one, you can insert the code found in the DescOR.vbs script into your scripts.
The following declaration and initialization should go in the beginning of your scripts:- Set DR = CreateObject("DescriptiveOR.Reader") DR.Load ("<ObjectRepository_xmlfile_path>")
Where <ObjectRepository_xmlfile_path> is the path for the xml file that represents your object repository.
You can insert the following function anywhere in your code Public Function Object(name) Set objReturn = Nothing strExec = DR.getObjectDefinition(name) strExec = "Set objReturn = " & DR.getObjectDefinition(name) Execute strExec Set Object = objReturn End Function
Tip:- For those of you who use Classes, the initialization would go in the Class_Initialize function .
Once you have done this much, your system is ready to use the Descriptive Repository. Anywhere in your script, you can simply say, Object(“Key”).DoWhatever and the quicktest’s object model is accessed.
Note :- The Tutorial illustrates the above steps with the aid of an example