AI Page Object Generator
The flagship feature of AutomateX. Generate complete, production-ready Page Objects from any webpage.
What It Does
- Analyzes the page structure (forms, buttons, links, inputs, tables)
- Identifies the best selector for each element
- Generates TypeScript code with full type safety
- Creates methods for common interactions
The Output
Given any webpage, AutomateX generates:
Locator Declarations
Every interactive element gets a typed, readonly locator using Playwright's recommended selector strategies.
Getter & Setter Methods
Form fields get automatic type-safe value accessors — getEmail(), setPassword(value), and more.
Action Methods
Buttons and links get dedicated click methods — clickSubmit(), clickForgotPassword().
Workflow Methods
Common patterns are auto-detected and combined into higher-level methods:
| Page Type | Auto-Generated Methods |
|---|---|
| Login | login(email, password) |
| Search | search(query) |
| Forms | fillForm(data) |
| Tables | getRowByText(), getCell(), getRowData() |
Selector Intelligence
Not all selectors are equal. AutomateX picks the best one:
| Priority | Selector Type | Why |
|---|---|---|
| 1 | data-testid | Explicitly for testing, never changes |
| 2 | role + name | Accessibility-based, stable |
| 3 | label | Semantic, user-visible |
| 4 | placeholder | User-visible, fairly stable |
| 5 | CSS | Last resort, may be fragile |
Fragile selectors are flagged with warnings so you can improve them.
Duplicate-Safe Generation
AutomateX handles real-world HTML complexity:
- Duplicate selectors are automatically disambiguated — no two locators share the same selector
- Duplicate method names get unique suffixes with JSDoc comments for clarity
- Navigation elements can be filtered out with focus-selector scoping
Enterprise Options
For larger teams, AutomateX supports:
- Separate Locators File: Keep selectors in dedicated files for easier maintenance
- Test Data Generation: Auto-generate valid, invalid, and empty test data sets
- Base Page Pattern: Extend a common BasePage class across all page objects
- Focus Selector: Scope generation to specific page sections (e.g., main content only)