playwright-excel
Integrate Excel (.xlsx) data into Playwright codegen scripts by replacing hardcoded values with config-driven lookups, loading data with polars, and validating every step with Playwright MCP (start MCP from the repo if not running). Use for Playwright automation updates that require Excel-backed data, config.yaml centralization, or MCP validation/reporting.
When & Why to Use This Skill
This Claude skill enables the transformation of static Playwright scripts into robust, data-driven web automation workflows by integrating Excel (.xlsx) data. It automates the replacement of hardcoded values with dynamic lookups, leverages Polars for efficient data handling, and incorporates Playwright MCP validation to ensure high reliability and centralized configuration management.
Use Cases
- Data-Driven Testing: Automatically execute Playwright test cases using multiple data sets sourced from Excel spreadsheets to increase test coverage and efficiency.
- Automated Bulk Data Entry: Streamline web-based data entry tasks by mapping Excel columns to Playwright actions for efficient, error-free form processing.
- Script Maintenance and Refactoring: Convert hardcoded automation scripts into maintainable, config-driven pipelines with centralized control via config.yaml and standardized data loading.
- Automated Validation and Reporting: Use Playwright MCP and MD5 checksums to validate automation outputs and ensure consistency across complex web-based workflows.
| name | playwright-excel |
|---|---|
| description | Integrate Excel (.xlsx) data into Playwright codegen scripts by replacing hardcoded values with config-driven lookups, loading data with polars, and validating every step with Playwright MCP (start MCP from the repo if not running). Use for Playwright automation updates that require Excel-backed data, config.yaml centralization, or MCP validation/reporting. |
Playwright Excel Integration
Overview
Convert Playwright codegen scripts into Excel-driven automations with centralized config and required MCP validation.
Environment
- Use the
playwrightconda environment. - Before running any Python command, run:
conda run -n playwright python -c "import sys; print(sys.executable)" - Do not create or activate any venv or
.venv.
Inputs
- Playwright codegen script path
- Excel
.xlsxpath - Mapping lines:
"hardcoded_value" -> Excel[Sheet][FilterCol==FilterVal][DataCol] - Optional override:
PLAYWRIGHT_TARGET_SUBJECT
Workflow
- Analyze the Playwright script and the Excel structure (sheets, columns, sample rows).
- Detect hardcoded
.fill()values and confirm that each has a mapping; request clarification for mismatches. - Ensure dependencies in the
playwrightconda env (preferconda install -n playwright, fall back toconda run -n playwright pip install). - Create or update
config.yamlusing centralized control (paths, patterns, column definitions, constants, tunables, shared texts). - Modify the Playwright script:
- Add a config loader and an Excel loader (polars; see
references/excel-loading.md). - Replace hardcoded values with
data[...].
- Add a config loader and an Excel loader (polars; see
- Always run Playwright MCP validation; if MCP is not running, start it from this repo before continuing (see
references/mcp-validation.md). - When refactoring existing pipelines/logic, generate outputs and compare MD5 checksums with reference files (see
references/md5-validation.md). - Run the updated script with
conda run -n playwright python.
References
references/excel-loading.mdreferences/mcp-validation.mdreferences/md5-validation.mdreferences/examples.md