Skip to main content
Glama

generate_java_junit5

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

Instructions

Generate a Java JUnit 5 test class from the current browser session. framework='junit5' (default) emits standalone Selenium with a ChromeDriver setUp/tearDown; framework='selenium_boot' emits a Selenium Boot test (extends BaseJUnit5Test, framework-managed driver, accessibility-first locators and web-first assertThat assertions). In a Selenium Boot project, use framework='selenium_boot'.

Input Schema

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

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

With no annotations, the description bears full responsibility for behavioral disclosure. It explains the generated output structure for both frameworks (e.g., standalone Selenium vs. Selenium Boot with specific locators and assertions). However, it omits side effects like file creation location, overwrite behavior, or permission requirements, leaving significant behavioral gaps.

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 remarkably concise with two sentences. The first states the core purpose, and the second efficiently explains both framework modes. Every sentence serves a distinct function without redundancy or verbosity.

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 the tool's complexity (two frameworks, three parameters, no output schema), the description covers the framework distinction well but lacks details on how the test class is output (e.g., filename, directory, overwrite policy) and assumes prior knowledge of recording browser sessions. This leaves some operational context unclear.

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?

Schema coverage is 33% (only 'framework' has a description in schema). The description adds depth for 'framework' by detailing what each emits, but does not mention 'test_name' or 'package_name' at all. Thus, it partially compensates for the low coverage but ignores two parameters.

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 clearly states 'Generate a Java JUnit 5 test class from the current browser session,' specifying verb, resource, and context. It distinguishes itself from sibling tools like generate_java_testng by explicitly targeting JUnit 5 and detailing two framework modes (junit5 and selenium_boot), which differentiates it from other generation tools.

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 provides internal guidance on when to use each framework mode, stating 'In a Selenium Boot project, use framework='selenium_boot'.' However, it does not compare against sibling tools (e.g., generate_java_testng) or explicitly state when not to use this tool, missing a clear contrast with alternatives.

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