Introduction

Agent2Agent (A2A) is an open protocol enabling communication and interoperability between opaque agentic applications. Parasoft SOAtest is well-suited for testing A2A with its built-in JSON processing tools, LLM integration, and extensions for a wide array of underlying transports.

A2A Test Scenario Example

The following example illustrates how to create an A2A test scenario in SOAtest:

  1. Create a new .tst and an environment with the URL to your Agent Card.
  2. Create a REST Client as a Set-up Test to GET the Agent Card using the environment variable ${AGENT_CARD} for the resource.
  3. Create a Data Generator Tool as another Set-up Test to generate two random, unique ID Strings for JRPC_REQUEST_ID and A2A_MESSAGE_ID.
  4. Create a Messaging Client as a Standard Test to send a message to the agent.
  5. Configure the message request. Change to Input mode: Literal and select MIME type: application/json. Paste in the following and configure your prompt to the agent:
    {
        "id" : "${JRPC_REQUEST_ID}",
        "jsonrpc" : "2.0",
        "method" : "message/send",
        "params" : {
            "message" : {
                "kind" : "message",
                "messageId" : "${A2A_MESSAGE_ID}",
                "parts" : [               
                    {
                         "kind" : "text",
                         "text" : "<your prompt here>"
                    }
                ],
                "role" : "user"
            }
        }
    }
  6. Add a JSON Assertor to the Response Traffic to check for errors and assert that the result state is complete.
  7. Add a JSON Data Bank to the Response Traffic to extract the result text into a custom column named RESULT_TEXT.
  8. Add an AI Assertor as a Standard Test after the Messaging Client. The AI Assertor in SOAtest will use its LLM integration to decide if the result text meets the acceptance criteria.