Generate a scenario

You generate a scenario from a guilog file.

Note: The GGC command line is a string without line breaks. Line breaks may have been added to the command line examples in this section to support the printed version of our documentation.
This procedure creates a test scenario for the Orders.42r application. It assumes that your command line environment is properly set, and that all files can be found. You would replace the name "Orders" with the name of your application.
Tip: Open a Genero Workplace Window to provide a well-configured environment.
  1. Navigate to your test directory.
    This example uses a directory named /test_dir.
  2. Type fglrun --start-guilog="Orders.guilog" Orders.42r.
    The application launches in recording mode. The --start-guilog option specifies the file name for the guilog.
    The Orders.guilog file is created.
  3. Use the application to complete a series of steps. When you have completed the steps for your test, exit the application.
  4. Type java com.fourjs.ggc.generator.GhostGenerator Orders.guilog com.fourjs.ggc.generator.BDLProducer Orders_test.4gl.
    This command uses the GhostGenerator class to generate a scenario from filename.guilog.
  5. Type fglcomp -I FGLDIR/testing_utilities/ggc/lib Orders_test.4gl.
    Note: The generated test relies on the macros and functions defined in the BDL GGC lib provided in FGLDIR/testing_utilities/ggc/lib. The path must be included (-I) for the compilation.
    The generated test scenario compiles and creates the application file Orders_test.42m.
  6. Type one of the following commands to run the test.
    To directly launch the test application: fglrun Orders_test --launcher "fglrun Orders" --workingDir "\test_dir" –useLogTiming
    To run the test application using the Genero Application Server: fglrun Orders_test --launcher "http://localhost:6394/ua/r/Orders" –useLogTiming
    The test scenario application runs against the referenced application in the referenced location.
    These are options available for use by the generated test, to provide details needed to run the test successfully. Each option can be omitted if not needed.
    --launcher cmd-or-url
    Specify the command or URL to use to run the tested application.
    If a URL (a string starting with "http:" or "https:) is detected, the application will run using the GAS and the UA protocol. Otherwise, the GGC will consider the string as a command and connect to it using the direct protocol.
    For example: fglrun Orders_test --launcher "fglrun Orders"
    If the --launcher option is not specified, the tested application will run using the command fglrun appName where appname is extracted from the guilog used to generate the application.
    --workingDir path
    Specify the application working directory when running is direct mode. The working directory of the application process will be set to this path.
    For example: fglrun Orders_test --launcher "fglrun Orders" --workingDir "\test_dir"
    If the --workingDir option is not specified, the default is the current working directory.
    This parameter should not be specified when running against the UA protocol.
    --useLogTiming
    When specified, the scenario will play at the pace specified in the guilog; the test executes in the same time as the recorded session.
    For example: fglrun Orders_test --launcher "fglrun Orders" --useLogTiming
    fglrun Orders_test "fglrun Orders" "\test_dir"
    If this parameter is omitted, the test plays as quickly as possible.
The test runs and the results display in the output.