ggcgen

You use the ggcgen BDL tool to generate test scenarios from a recorded session. It accepts logs recorded by the DVM (guilog) or logs recorded using the Genero Desktop Client (GDC) or Genero Browser Client (GBC).

Syntax

ggcgen { -V | -h | command [options] argument [...] } 
  1. command is either bdl to generate a test scenario in BDL, or java to generate a scenario in Java.
  2. options are described in Options.
  3. argument are log files or skeleton names passed as argument from which scenarios are generated. One scenario per log file. With the --skeleton option, an empty scenario is generated without using a log file.

Options

Table 1. ggcgen version, help, and output options
Option Description

-V or --version

Display GGC version information.

-h or --help

Displays help for the ggcgen commands.
-v or --verbose Generate verbose output for help with debugging. This option is not enabled by default.
--output-directory Specify where to place generated files. Default is current working directory.
--comment-prefix argument The template's comment prefix. The default punctuation is two exclamation marks, !!, and lines with this prefix are filtered. The argument option allows you to specify an alternative prefix.
--dump-command Expand the command line options that are loaded from a default argument file. See Default argument file.
Table 2. ggcgen template directory option
Option Description
--template-directory argument [...] Specify template directories to use. The argument option can take a list of directories. The lookup will be performed in the order the arguments appear in the command line.
Table 3. ggcgen dump/wait options
Option Description
--no-wait Specify that wait instructions, such as BDL Call ggc.wait() or Java client.wait(), are not generated. The 'wait' instruction is expanded using the wait.4gl code template.
--dump-all Enables all information (AUI log, AUI tree) to be included in comments in the scenario. Default value is false.
--dump-auitree The state of the AUI tree is included in comments between each instruction sent to the DVM. Default value is false.
--dump-auilog The source log file used to generate the scenario is included in comments in the instructions between the AUI tree and the client. Default value is false.
Table 4. ggcgen check options
Option Description
--check-all This option provides you with optional checks that can be generated and then performed at runtime. It enables all checks provided by the templates in GGCDIR/template/bdl/check_*.4gl.
--check-window This option checks the current window name and title using the template GGCDIR/template/bdl/check_window.4gl
--check-form This option checks the current form name and title using the template GGCDIR/template/bdl/check_form.4gl.
--check-focus This option checks the focused field using the template GGCDIR/template/bdl/check_focus.4gl.
--check-value This option checks the value of the focused field using the template GGCDIR/template/bdl/check_value.4gl.
--check-actions This option checks the active/inactive state of an action using the template GGCDIR/template/bdl/check_action.4gl.
--check-messages This option generates code to check that MESSAGE and ERROR instructions contain expected messages values. It also checks in case values are missing. The GGCDIR/template path has the following templates that enable these checks based on whether your test uses Genero BDL or Java:
  • check_message
  • check_no_message
  • check_error
  • check_no_error
Table 5. ggcgen skeleton option
Option Description
--skeleton This option allows you to generate an empty scenario. The header.4gl and footer.4gl templates only will be generated in the named scenario. Dump and check options will be ignored.
--package-name This option is used with the ggcgen java --skeleton command. It allows you to specify the Java package name.

Usage

You use the ggcgen tool to generate scenarios from a recorded session.

There are several options you can use to effect the generated scenario. You can set the template directory to one with your specific checks. Or if you want to perform standard checks, you can set these with the check options.

For example, for BDL:
ggcgen bdl --template-directory ${GGCDIR}/template/bdl/alternate-checks --check-all mylog.log
Or for Java:
ggcgen java --template-directory ${GGCDIR}/template/bdl/alternate-checks --check-all mylog.log
There are options to debug (--dump-*) when you need to see detailed information such as the state of the AUI tree generated in the scenario.
Note: In the normal course of testing it is not expected that you will need to use the dump options, except perhaps if the scenario does not behave as expected. Then generating more verbose details may help you to understand where and why it fails.

You can use the --skeleton option to generate an empty scenario. The code from the header and footer templates only will be expanded. It does not require a log file, just the name of the scenario to generate. Multiple scenarios can be created by listing them separated by spaces.

For example, for BDL:
ggcgen bdl --skeleton tests
Or for Java:
ggcgen java --skeleton --package-name tests myscenario