Testing agents

About this task

You can test an agent in the following ways:

  • For agents that do not call other agents, use the Test menu command.
  • For agents that use LotusScript®, use the LotusScript debugger.
  • For more complicated agents, create a test copy of the database you can work with before you work with the original database.

To use the Test menu command

Procedure

  1. Select the agent and choose Agents - Test.
  2. Read the Agent Log and check:
    • How many documents would be processed (for formula and simple action agents)
    • What action would be taken if the agent were actually run
  3. If necessary, make corrections and run the test again.

To use the LotusScript debugger

Procedure

  1. Choose Tools - Debug LotusScript.
  2. Run the agent and the LotusScript debugger appears. You can then review each step as the agent runs.
  3. You can also use message boxes and print statements.

To create a test database

About this task

You may wish to make a test copy of an existing database before working with the actual database.

For agents that have multiple steps or complex tasks, split the process into several smaller tasks and create an agent for each. Test and fix each smaller agent first. When everything is working correctly, combine the agents into one. Then test the agent again.

Note: Java™ agents have a console tool to which agents can print messages. In Domino® Designer, choose Tools - Show Java Debug Console. In addition, you can use the remote debugging tool (Tools - Remote Debugging), which allows remote debugging of the LotusScript in an agent script and allows the monitoring of the execution of Java agents.

Procedure

  1. Choose File - Application - New Copy to make a test copy of the database, with documents.

    If the agent works on mailed documents, the test database must be on a server, and a Mail-in Database document must exist in the Address Book.

  2. Create test documents:
    • If the agent works on mailed documents, mail a few documents to the test database.
    • If the agent works on pasted documents, paste a few documents into the test database.
  3. Optional: Create a debug document to write values to.
  4. Run the agent.
  5. Use other available debugging tools to catch errors and make corrections.
  6. Rerun the agent until it is working correctly.
  7. Copy the tested agent to the live database.