![]() |
|||||
|
Home | About Us | Products | Sales | Demos | Links | Support | Contact Us |
|||||
|
PRODUCTS
|
Page 3 — Editing a Script Vermont HighTest includes a built-in script editor that automatically handles the translation of scripts to and from the binary format they are stored in. Now that you have completed the recording session and have generated a script, you may edit this script by adding comments, conditional tests, loops, declare variables, etc. The scripting language used by Vermont HighTest Plus was developed by us to address many issues faced by quality assurance testers. The biggest issue we found is that while historically most testing was done by programmers, today, more and more people involved in QA departments are not programmers, and as such, do not know the ins and outs of most programming languages. So we developed the scripting language for HighTest with a Natural Language Syntax such that the commands are easy to understand by their name and the language only includes those commands that are necessary for the testing process. And because the recording process creates accurate scripts while you are working with your application, you don’t have to start each script from scratch, saving you large amounts of time and allows you to get comfortable with the scripting language before you find that you want to do more sophisticated things with the script such as making it data-driven or performing a conditional test to control the flow of the script. Just because we created the scripting language to be easy-to-use, don’t think that it isn’t powerful. If you’re a programmer, you will find that it includes all of the common language constructs that you will find in other languages such as if/then/else, goto, for/next, call() and includes full variable support for data types string, integer, long, single float and double float. Power features include the ability to read data out of any recognized control, and for controls with multiple items such as a ListView or TreeView, you can extract the data out of them one at a time for a very fine level of control over what data you extract — a feature not likely to be found in other testing tools. To get you going, we have examples posted on our website for getting data out of most of the supported controls. Here’s an example of a script that you would record by following along with our basic tutorial:
Note the header used here is the default header. This can be modified as outlined on Page 1 of the Tour. The first line of the script is the StartApp() command. In this case, it is being opened from the tutor directory and HighTest will let Windows decide on the size and location of the file. As soon as the user clicks or starts typing in the window, HighTest records an ActivateWindow() command to ensure that the window will receive focus during playback. Next the tester started entering some text into the notepad window and HighTest captured the text along with the time between each keystroke. This allows the speed of playback to be adjusted from very slow to real-time to as fast as Windows can accept the commands. Non-printable keys are included in a special format so you can see and edit them in the script. Because Notepad uses a standard menu, HighTest was able to translate the mouse clicks in the menu into a high-level object command that is much more descriptive, self-documenting and concise than the multiple commands that would be in the script otherwise. Testing is all about verifying the proper operation of the script during playback, so during the record session, the user told HighTest to capture a single window on the screen, which was named "App Window 1". During playback, HighTest will capture the same screen and compare it to the image that is stored in the database from the record session. There are many other ways to verify the correct operation of your application that are discussed in much more detail on Page 5. Lastly, the user chose the File menu option Exit, and because the text has not been saved, was presented with a window asking them to save. Here the user clicked on the No button and then suspended and ended recording. If you are adding or modifying a command, and need help with it, the editor includes context-level help on all script commands. Positioning the cursor on a script command and pressing F1 will display the reference page for that command in the help file. For more information on the scripting language, go to Page 8 in the tour for details on all the commands. Importing/Exporting Scripts Sometimes you may wish to store your scripts as plain text files instead of in HighTest’s binary format. HighTest provides you with two methods to import and export scripts between text and binary formats. The first method is to use HighTest itself. Saving a script with an extension other than HighTest’s .inb extension will cause the script to be saved as a text file. Similarly, if you load a text file into a script editor window and save it with a .inb extension, HighTest will compile it automatically and save it as a script file. The second method involves using the HighTest Script Converter. This separate utility is provided primarily to convert scripts from the previous binary format to a new binary format. But in addition to that, it can convert one or many scripts to text or to binary formats with just a few clicks of the mouse. This is especially useful if you want to store text versions of your scripts in a version control system so that you can compare different versions of scripts in a text format easily from the version control system. Command-line options allow you to automate this process through a batch file so you don’t need to perform this operation interactively each time. |
||||