Skip to main content
Glama

generate_java_page_object

Generate Java Page Object classes and matching test files from recorded Selenium sessions. Supports TestNG and JUnit 5 frameworks.

Instructions

Generate a Java Page Object class + matching test class from the recorded session. Produces two files: a Page Object (locators + fluent action methods) and a Test class that uses it. Supports TestNG and JUnit 5.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_nameNoName of the page class e.g. LoginPage. Auto-inferred from URL if omitted.
package_nameNocom.tests.selenium
frameworkNotestng
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral aspects. It mentions output is two files and supported frameworks, but omits details like overwrite behavior, prerequisites, or side effects.

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 three concise sentences: action, output, supported frameworks. No redundant text, front-loaded with key information.

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

Completeness4/5

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

Given the complexity (two files, two frameworks, three parameters) and no output schema, the description covers the output nature and supported frameworks. It lacks mention of file location or prerequisite of a recorded session, but is mostly complete.

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 description coverage is only 33% (only page_name has a description). The description adds value by stating page_name can be auto-inferred from URL, but does not elaborate on package_name or framework beyond defaults/enums.

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 the tool generates a Java Page Object class and a matching test class from a recorded session, specifying the two output files and supported frameworks. It distinguishes from sibling tools that generate test files directly.

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 implies usage after a recorded session and supports TestNG/JUnit5, but does not explicitly compare to other generation tools like generate_java_junit5 or provide when-not-to-use guidance.

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