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
- Select the agent and choose Agents - Test.
- 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
- If necessary, make corrections and run the test again.
To use the LotusScript® debugger
Procedure
- Choose Tools - Debug LotusScript®.
- Run the agent and the LotusScript® debugger appears. You can then review each step as the agent runs.
- 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
- 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.
- 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.
- Optional: Create a debug document to write values to.
- Run the agent.
- Use other available debugging tools to catch errors and make corrections.
- Rerun the agent until it is working correctly.
- Copy the tested agent to the live database.