Creating a Script that Uses Both Agents

You can create a script that uses the Classic Agent and the Open Agent. Recording primarily depends on the default agent while replaying the script primarily depends on the window declaration of the underlying control. If you create a script that does not use window declarations, the default agent is used to replay the script.

  1. Set the default agent to the Classic Agent.
  2. In the Basic Workflow bar, enable extensions for the application automatically.
  3. In the Basic Workflow bar, click Record Testcase and record your test case.
  4. When prompted, click Paste to Editor and then click Paste testcase and update window declaration(s).
  5. Click OK. The frame now contains window declarations from the Classic Agent.
  6. Click File > Save to save the test case.
  7. Type a name for the file into the File name field and click Save.
  8. Set the default agent to the Open Agent.
  9. Click Options > Application Configurations. The Edit Application Configurations dialog box opens.
  10. Click Add.

    The Select Application dialog box opens.

  11. Configure a standard or Web site test configuration.
  12. Click OK.
  13. Click Record Testcase in the Basic Workflow bar and record your test case.
  14. When prompted, click Paste to Editor and then click Paste testcase and update window declaration(s). The frame now contains window declarations from both the Classic Agent and the Open Agent. Silk Test Classic automatically detects which agent is required for each test based on the window declaration and changes the agent accordingly.
  15. Click File > Save to save the test case.
  16. Click Run Testcase in the Basic Workflow bar to replay the test case. Silk Test Classic automatically recognizes which agent to use based on the underlying window declarations.

You can also use the function Connect([sMachine, sAgentType]) in a script to connect a machine explicitly with either the Classic Agent or the Open Agent. Using the connect function changes the default agent temporarily for the current test case, but it does not change the default agent of your project. However, this does not override the agent that is used for replay, which is defined by the window declaration.