Installing the Generic Version of ATCG

Before you install the generic version of ATCG, install the Erewhon variant so that you can refer to the provided examples (for details, see "Installing the Erewhon ATCG Variant", in the previous section).

You can have multiple instances of the Automated Test Code Generator in your JADE system, as long as each instance has a different name.

If you do not specify a unique profile and schema name for each schema in the JADE system into which you load ATCG, when you record and replay GUI actions using the control application (that is, the AtcgTestCodeSchemaApp class atcgControlAppInit method), ATCG freezes up and repeatedly generates unhandled exceptions.

If you load more than one instance, rename each one within the Application class atcgGetControlOptions method in each schema into which you load it; for example:

/* the schema and its superschema into which to generate profile classes; for example, DSProfile and DSAtcgGeneratorSchema when targeting DummySchema */
genSchema := "DSAtcgTestCodeSchema";
genSuperSchema := "DSAtcgGeneratorSchema"; 

To install the generic version of ATCG

  1. Back up your database.

  2. Enable method tracking, by updating your JADE initialization file so that the value of the MethodTrackingEnabled parameter in the [JadeSecurity] section is set to true.

  3. Load the AtcgGeneratorSchema (that is, the AtcgGeneratorSchema_Generic.scm and AtcgGeneratorSchema_Generic.ddb or AtcgGeneratorSchema_Generic.ddx files) as a subschema of the schema in which the target application runs.

  4. Load the AtcgTestCodeSchema (that is, the AtcgTestCodeSchema_Generic.scm and AtcgTestCodeSchema_Generic.ddb or AtcgGeneratorSchema_Generic.ddx files) into the AtcgGeneratorSchema target schema.

  5. In AtcgTestCodeSchema, change the name of the XxxProfile class, a subclass of AtcgProfile, to a prefix suitable for your application. This will be the superclass for all of your profile test classes.

  6. Modify the Application class atcgGetControlOptions and atcgRecordAppInit methods (in AtcgTestCodeSchema) with the new class name, by replacing instances of XxxProfile with the profile class name that you selected in the previous step of this instruction.

  7. In the AtcgTestCodeSchemaApp class atcgGetControlOptions method, enter the list of target schemas to be tracked; for example:

    .... 
    // list of schemas to be tracked during recording 
    targetSchemas.add("SecondDocExampleSchema");
    targetSchemas.add("TrainingExampleSchema");
    ....

    This array should include all schemas containing forms that are used by your application, including inherited and peer schemas. If there is one schema only, replace XxxSchema with the name of that schema.

    Many applications contain additional schemas such as CardSchema and BaseSchema, which should not be listed unless your application uses form classes defined in those schemas.

  8. In the AtcgTestCodeSchemaApp class atcgGetControlOptions method, there is a list of "noise" methods to ignore. These are normally application methods that are called many times, and are not relevant to ATCG; for example, app.convertStringToYesNo. You may not know what to list until you have used ATCG for a while.

    Do not list any control or form event methods, as that may affect code generation.

  9. Check that the AtcgControlApp application in AtcgTestCodeSchema runs.

    This application should run without modification, unless there is something in your security code that prevents it; for example, your global.getAndValidateUser method may validate schema names or application names. While you are examining your security code, keep in mind that the AtcgRecordApp and AtcgReplayApp applications will also need to run in AtcgTestCodeSchema.

  10. Get the AtcgRecordApp application working. This needs to run your target application, but it needs to run from within AtcgTestCodeSchema with the application name AtcgRecordApp, as follows.

    1. Reimplement the app.initialize method (which is called from the app.atcgRecordAppInit method) with code similar to your application's initialize method.

    2. Modify the method called startup in your profile superclass that you changed in step 3 of this instruction. This should create the main form and log-on form of your application.

    3. Change the method called stop, to log off and close the main form.

    For examples of the start and stop methods, see the sample Erewhon test code schema.

    When you can bring up the main form of your application and are logged in automatically, you can use the application as normal and close it down again cleanly, you are finished with this step.

  11. Get the AtcgReplayApp application working, as follows.

    1. You will first need a sample profile class to run. Run the AtcgControlApp application, which needs to be run as a standard (fat) client.

      At this stage of installation, you should run the JADE development environment as a standard client and run all of the ATCG applications from there. Alternatively, you could create the appropriate shortcuts.

    2. In the AtcgControlApp application, click the Start Recording button, which starts the AtcgRecordApp application automatically.

    3. When the Please Wait form is no longer displayed, click the Generate and Load button. The AtcgRecordApp application will then terminate and a new profile class will be generated and loaded.

    4. Click the Replay Last button. The main form of your application should be displayed briefly.

Basic installation is now complete.

Further modifications may be required to automatically handle items such as message boxes and modal forms. For details, see Chapter 4, "Design Guidelines and Directions".