Skip to main content
Glama

generate_java_testng

Generate a Java TestNG test class from the current browser session, supporting TestNG standalone or Selenium Boot framework.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkNoOutput flavor. Use 'selenium_boot' inside a Selenium Boot project.testng
test_nameNoRecordedFlowTest
package_nameNocom.tests.selenium
Behavior3/5

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

No annotations are provided, so the description must carry full weight. It explains what each framework emits (standalone Selenium vs. Selenium Boot with specific locators and assertions). However, it does not disclose side effects (e.g., whether it modifies the session), prerequisites, or error handling.

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

Conciseness4/5

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

The description is front-loaded with the main purpose and provides useful details in a structured manner. It is slightly verbose but every sentence adds value. Could be trimmed slightly without losing clarity.

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

Completeness3/5

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

Given no output schema and limited parameter descriptions, the description adequately explains the two framework flavors. However, it does not describe the output format (the generated class structure) or any constraints (e.g., required browser session state). It is sufficient for a code generation tool but lacks completeness.

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?

The schema has 3 parameters with 33% description coverage (only 'framework' has a schema description). The tool description adds value for 'framework' by explaining the enum values and usage context. For 'test_name' and 'package_name', no additional meaning is provided beyond their names.

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

Purpose5/5

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

The description uses specific verbs ('Generate... Java TestNG test class') and clearly identifies the resource ('current browser session'). It distinguishes between two framework flavors, differentiating it from sibling generation tools like generate_csharp_nunit.

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

Usage Guidelines4/5

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

The description explicitly states when to use 'selenium_boot' ('In a Selenium Boot project...') and implies that 'testng' is the default. It does not explicitly state when not to use the tool, but the guidance is clear for the main use cases.

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

Install Server

Other Tools

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/seleniumboot/selenium-mcp'

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