Skip to main content
Glama

generate_java_testng

Turn recorded browser sessions into ready-to-run Java TestNG tests, choosing TestFly or raw Selenium frameworks to eliminate boilerplate and produce maintainable, accessible locator-based assertions.

Instructions

Generate a Java TestNG test class from the current browser session. framework='testfly' (default) emits a TestFly test (extends BaseTest, framework-managed driver, open(), accessibility-first getByRole/getByLabel/getByTestId/find locators and web-first assertThat assertions — no driver lifecycle boilerplate). framework='testng' emits standalone raw Selenium with a ChromeDriver setUp/tearDown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkNoOutput flavor. Use 'testfly' (default) inside a TestFly project.testfly
test_nameNoRecordedFlowTest
package_nameNocom.tests.selenium

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It discloses the generated code shape (BaseTest extension, managed driver, locator style, no lifecycle boilerplate vs standalone ChromeDriver setup/teardown), but it does not state whether generating a test modifies the browser session, writes a file, or is otherwise side-effect free.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded, with the core purpose in the first sentence and the key framework variants packed into one additional sentence. Every clause adds useful information and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a code-generation tool with no annotations and no output schema, the description is incomplete: it documents two of the three framework enum options, omitting 'selenium_boot', and never explains what the generated artifact is (e.g., file output, in-chat code block) or what happens to the current session. An agent cannot fully resolve the intended behavior for all allowed inputs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only the framework parameter has a schema description, so coverage is low at 33%. The description adds real meaning for framework='testfly' and 'testng', but it ignores the third enum value 'selenium_boot' and provides no additional semantics for test_name or package_name beyond the self-explanatory names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Generate a Java TestNG test class from the current browser session.' It also details the two framework flavors, making the intent clear, though it never explicitly contrasts with generate_java_junit5 or other sibling code generators.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to get TestFly vs raw TestNG/Selenium output and implies this is the right tool for Java test generation, but it does not explicitly state when to choose this tool over generate_java_junit5 (or other language/framework generators), nor does it give exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hakanngul/testfly-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server