Quick Start: Scenario failure

Test introducing a failed scenario.

Before you begin
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 GDC.
    Launch the GDC monitor from the shortcut on the Start Menu (Windows®). For more details for your OS, see the Genero Desktop Client User Guide.
    The GDC 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. 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.