Using macros

You can record a macro to create a set of steps to be taken automatically, such as providing information for entry fields or selecting menu options. For example, to access a host application, a user needs to log on to the system with a user ID and password. Logging on to the system is a good candidate for a macro, because your project can traverse the logon screens for the user of your application. Also, using the Visual Macro Editor you can edit the macro to add a conditional path to take if the user ID or password have expired.

To record a simple logon macro, follow these steps:
  1. Highlight a project in the ZIETrans Projects view, and click the Open ZIETrans Host Terminal icon (Open Host Terminal icon).
  2. Start from the host terminal screen displaying the logon screen, and click the Record Macro icon (record macro icon).
  3. On the Record Macro panel, select the target project, give the macro a name, such as mylogon, and optionally, add a description. Click Finish.
  4. On the Define the starting screen of the macro panel, you can name the screen or accept the default name. For this example, name the screen logon. Select an area of the screen to be used to recognize the screen. Since a logon screen usually has static text, you can select any text on the screen. Notice that the Strings check box is selected. You should select the At a specified position option of the string position criteria, since the selected text should always be in the same location. The Row and Column fields are filled in with the coordinates of the screen area you selected. Click Next.
  5. On the Recognition Criteria for Screen panel, the text used to recognize the screen is already defined for you, using information collected from the previous screen. Click Finish.
  6. On the host terminal screen displaying the logon screen, enter the user ID and password required and press the Enter key. To the left of the host screen, the progression of the macro displays in the Macro Navigator pane.
  7. There might be other screens that always appear during logging on to a host that are not necessary for the end user to see. Take any action that you would normally take on these screens when logging on, until you navigate to a screen from which you can access the host application for your project. This screen might have some explicit text on it that indicates that an application can be accessed, such as Sign-on complete or Main Menu.
  8. Click the Stop Macro icon (stop macro icon).
  9. On the Define the exit screen of the macro panel, give the exit screen a name, such as finalscreen. This time, you are defining recognition criteria for the last screen in the macro. Most likely, this is the screen that has the Sign-on complete or Main Menu text on it. You can select this text to be used to recognize the exit screen for the macro. If the text you select will always be located at the same position on the screen, select the At a specified position option of the string position criteria. Otherwise, select the Anywhere on the screen option. Click Next.
  10. On the Recognition Criteria for Screen panel, the text used to recognize the screen is already defined for you, using information collected from the previous screen. Click Finish.
  11. You now have recorded a macro that logs a user on to the system. To add this macro to your project, click the Save Macro icon (save macro icon).
  12. Now you can close or minimize the host terminal screen, and you can see the macro named mylogon under the Macros folder of your project in the ZIETrans Projects view.
You can run the mylogon macro as an action in a screen customization to log a user on to the host system.

For more information about recording and using macros, refer to Macros and host terminal and Introducing advanced macros.