Generate Java test scenarios

Generate a Java file set of SessionManager and Scenario classes from recorded log files.

Before you begin:
  • Make sure that the /samples directory where your GGC package is installed has the following log files:
    • StartMenu.log
    • DemoPanel.log
  • It is assumed your environment is configured to run Java and the GGC, see Configure your environment for Ghost Client.
  1. Type the command:

    java com.fourjs.ggc.Launcher --write path/to/generate/DemoPanel --log samples/DemoPanel.log

    Note:
    • The --write option writes the test file set to path/to/generate/. If some or all directories in the specified path, do not already exist, they will be created. If the path specified is not absolute, GGC will consider its own directory as root.
    • The name of the generated class file is fully qualified. Therefore it will be made up of the series of directories from the CLASSPATH to the path to where the compiled classes are located (the package), with the file name (without extension) added at the end:
      • Package name

        path.to.generate

        Path to files

        path/to/generate

    • If Java files with the same name already exist at the same location, an error will be raised.

Once the Ghost Generator feature has been run, the generated Java files need to be compiled as described in the next step.

  1. To compile your newly generated tests, type the following:

    javac path/to/generate/*.java

    The resulting file set can either be executed as is, see Run the demo integrity tests with Java, or can be modified to do additional tests.