Agentic Workflows with the SmartBear MCP

Problem / goal

This article addresses how to create and run Reflect tests using your AI agents such as Claude Code, Codex, Cursor, etc. by integrating it with the SmartBear MCP server.

Solution

Install the SmartBear MCP server. Use the following link for instructions. you must set the REFLECT_API_TOKEN environment variable for the SmartBear MCP server to authenticate and use the Reflect MCP tools.

Click here for instructions

Use case: Import tests from other testing frameworks

Users can direct AI Agents to leverage create_segment & create_test tools to import their existing Selenium/Playwright/Cypress tests into Reflect. Users of other SmartBear products like TestComplete & BearQ can also leverage these MCP tools to import their test cases as well. If the existing tests are complex, it may require some additional edits, but this is a much quicker and easier alternative than rewriting/re-recording tests from scratch. The below videos highlight this workflow.
Watch this video for a Playwright demonstration
Watch this video for a TestComplete demonstration

Use case: Agentic test creation

The following example will outline how an existing test artifact (such as the SAP best practice document) can be used to generate an automated test by pairing an agent with the SmartBear MCP server.

Once the user sets up the SmartBear MCP server, they may interact with their agent of choice and use the MCP prompt like:
/mcp_smartbear_reflect-sap-test I want to create an sap test case on scenario 4.2.3.1 from this BPD document <path/to/SAP_best_practice.docx>

If users are on Claude, they can leverage the prepackaged /reflect-sap-test MCP prompt that comes with the SmartBear MCP server

/reflect-sap-test prompt:

When creating an SAP test:

  1. Always precede an input step with a click step.

  2. Always capture a screenshot after each step, even form field actions.

  3. If text is ellipsized with a hyphen, do not include the hyphen in your prompt step.

  4. If you navigate to the wrong page, use browser navigation (e.g. “Click the back button”) or on-screen navigation to get to the prior screen. Make sure to delete the original step and any steps you added to navigate back to the previous screen so that the test is repeatable and contains no unnecessary steps.

  5. When applicable, use the prompt “Press the tab key” to tab through fields and the prompt “Press the enter key” to submit a form.

  6. When building tests from BPD docs, if the input value for the next step is based on an example value in the doc, prompt the user to ask for their desired value. Provide the example value in your prompt so the user has additional context.

Related