Quick Start: Scenario failure

Test introducing a failed scenario.

Before you begin

To complete this quick start, it is assumed that you have downloaded and installed the GGC package. If you need to perform this task, go to Install the GGC package.

You must have:
  • A complied price.42m application.
  • A generated guilog named price_sample.guilog.
If you need either of these files, complete the steps in Quick Start: Generate and execute a test scenario.
About this task

In this quick start, you are testing for a scenario failure by triggering an action that does not exist in the application. This will be trapped in your GGC test.

Steps

  1. Start the Genero Desktop Client.
    For OS-specific instructions on starting the Genero Desktop Client, see the Genero Desktop Client User Guide.
    The Genero Desktop Client launches and you see the monitor screen.
  2. Modify an action() call in price_sample.4gl.
    Open the price_sample.4gl for editing. Replace an action name with "it_will_fail". For instance, if you change the price, you will find the following in the source file:
        CALL ggc.action("accept") -- OK
    You can update this to replace the action name with the invalid action name:
        CALL ggc.action("it_will_fail") -- OK
  3. Compile the scenario.
    fglcomp price_sample.4gl
    The generated test scenario compiles and creates the application file price_sample.42m.
  4. Start the GGC server.
    Before you execute a test scenario, you must start the GGC server. To continue in the same terminal window, you must run the command in the background; alternatively, you can open another terminal to start the GGC server from.
    • UNIX® like OS:
      ggcadmin startbdlserver &
    • Windows®: Use "start /min" to have the command run in a new, minimized window:
      start /min ggcadmin startbdlserver
  5. Type the following commands to run the test:
    fglrun price_sample tcp --command-line "fglrun price"

    Where the path to the test application (price_sample) and the application being tested (price) is the current working directory.

    The test runs, and the results display in the output.
    Figure: Output for scenario failure quick start


    The scenario is marked as failed. Notice that there is a Scenario failures section, and that there you see "GGC-9" with the message describing the failure.

    Note:

    The output is intended as a sample to show test session statistics, the format may change in future product releases.