Using macros for testing

We recommend that you plan your software tests before you begin recording macros. Properly planned, each macro can perform a specific test and produce a measurable or observable result. Good planning also prevents macros from becoming longer than necessary.

For example, it’s not efficient for a macro to open a lookup window when no information exists to be retrieved. Through careful planning, you can avoid unnecessary steps and create macros that run more quickly and are easier to debug.

Be sure to test each macro after you record it to ensure that it is working properly.


Editing macros

Sometimes when you are recording macros you will make a mistake or forget a step. In these situations, you can use a text editor or word processor to edit the macro file.

We don’t recommend that you write macros from scratch. Instead, you should use the macro system to record mouse and keyboard actions, then edit your macros if necessary.


You can use a text editor or word processor to edit the macro directly. Be sure you save the macro as a text file with carriage returns at the end of each line, and assign the file the extension .MAC.

Macro files can become quite large. If you want to edit large macros, you will need to use a text editor or word processor capable of editing large text files.


Running macros

When you’re running macros, it’s sometimes convenient to store the macro-related warnings and messages (such as the time a macro took to complete) in a file, rather than displaying them on the screen. To have a macro’s messages stored in a file, edit the macro and add the Logging command as the first line of the macro. Refer to the Logging command in the online help for specific details about how to use this command.

Keys.ini file

You can use a special file named Keys.ini when running macros with the runtime engine. The Keys.ini file contains macro commands that are run at startup to configure various system behaviors. The macro commands in the Keys.ini are run only if the file is included in the parameters for the command to launch the runtime engine.

You create the Keys.ini file using a text editor, such as Notepad. The Keys.ini file is typically stored in the Data folder of your application installation.

To work properly, the Keys.ini file must also have a blank line as the last item in the file.


The following macro commands are typically used in the Keys.ini file:

 

The following is an example of a Keys.ini file:

SetEbDateTo date 01/01/1965/3
SetEbTimeTo 'o/s'
Logging file 'Regression_Test.log'
SetExitAction 'o/s'
MacroError limit 5
FilePath relative


Documentation Feedback