Scripts play an important role in the function of WinRunner. Those who wish to successful with this program will need to learn how to properly create scripts. In this article, I will provide you with a number of useful tips for script creation. The first tip of script development is to always place scripts in CVS.
This is important, because it will ensure that your scripts are organized. If you wish to clean up a directory structure before going forward, it is important to make sure you use the delete_files.vbs script. There are two script types that you will find with WinRunner, and these are the Compiled Module and the Main Test. To activate the Main Test, you will simply need to use Test-Run.
If you are working with a compiled module, you will need to use the main test. If you execute a script separately, you may find that unique names are generated. The unique names will also have information about the date and any other data that can be gained from reference information. If you invoke a script from another script, it may have input information that has important values. Another thing that you will want to pay attention to is the Batch Mode. The batch_mode will be used to make sure that the initialization of scripts are controlled. Once this variable has been activated, certain functions will not be reloaded each time a script is executed, and logs may be handed via MS Access.
You will want to set the batch_mode to "off" if you do not need to have MS Access log files. In most cases, you will want to deactivate this variable when you are in the process of either developing or debugging scripts. Another time where you will want to deactivate the batch_mode is when there is no need to constantly reload certain functions. The basic script design is another important part of using WinRunner properly. Some would suggest that File-Test Properties should not be used. One reason for this is because using this feature will only allow you to deal with script initialization, and it does not deal with finalization. It is important for developers to make sure they deal with finalization as well as initialization.
It is also important for developers to avoid problems with refreshing. To make sure that the management of the scripts is centralized, it is very important for users to make sure the navigation bar is selected by the right function. When you are analyzing the web browser window, it is important for you to be careful with how it is done. If you use the wrong command, it will either fail or go exceptionally slow. The best function to use for this process is the get_mainwin_desc() function. It should also be noted that each GUI element will have its own properties. WinRunner is consider some objects to be generic. Adding a customized property to an element will allow them to be processed as solid objects based the properties.
When an object is selected, you will want to make sure it is selected by its entire description. If you use a value set for the project name of the variable, you may find yourself with a number of problems. It is also important for you to make sure the element of the GUI property is set up correctly. The best way to do this is to make sure it is dynamic. One way to do this is to use the entire description of the element. However, you can also store the element within a GUI file, and you can change the location in a dynamic manner. By doing this, you will make the code much shorter, since you can use a name rather than a long description.
One of the most important tips for script design is to use a wildcard within a GUI file. Wildcards are very important when you wish to alter the description of an object from the GUI map. There are a number of examples you can study to make sure it is done properly. By learning how to properly design a script, you will find that using WinRunner becomes much easier. If you don't know how to design scripts properly, you can run into a number of challenges.