Run this model with HF Jobs
Run TheAutomatedTester/locator-model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/TheAutomatedTester/locator-model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/TheAutomatedTester/locator-model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use TheAutomatedTester/locator-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use TheAutomatedTester/locator-model with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'TheAutomatedTester/locator-model');
Upload README.md with huggingface_hub
Browse files14 unmodified lines15161718181920215 unmodified lines2728293030313233343 unmodified lines383940414243445 unmodified lines50515253545552565758593 unmodified lines636465626366676869707172731 unmodified line7576777879808171828384858687888977909192935 unmodified lines9910010189909192931021031041051061071081091101111121131141151161171181191201211221231241251261271281291307 unmodified lines1381391401091411421431441451461471131481491501517 unmodified lines15916016116216312716416516616716816913317017117217317417517613917717817918018118218318414318518618718819 unmodified lines2082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712727 unmodified lines28028128218228314 unmodified lines# 2. Build the projectnpm run build
# 3. Start the MCP server# 3. Start the MCP server (builds first)npm start```
5 unmodified lines
## Key Features
- **Automated Web Crawling**: Headless Chrome via Selenium extracts pages and DOM structure- **Automated Web Crawling**: Headless Chrome via Selenium extracts pages and DOM structure, one page or a whole site- **Workflow Detection**: Multi-page crawls find user journeys (login, registration, checkout, search) and can log in with supplied credentials- **Intelligent Element Analysis**: ML-powered semantic scoring identifies high-risk/high-value elements on the page- **Test Case Generation**: Automatically generates structured test cases with: - Priority levels (critical, high, medium, low) based on intent scores3 unmodified lines- **Semantic WebMCP Tools**: Auto-generated domain-specific tools for browser-side execution- **Multiple Output Formats**: JSON, detailed Markdown reports, or summary Markdown- **Natural Language Locators**: Find stable CSS/XPath selectors for any element by describing it- **ARIA Advisory**: Opt-in review that flags ARIA likely to mislead assistive-technology users
---
5 unmodified lines| **[USAGE.md](USAGE.md)** | Comprehensive guide to using the library, API reference, examples, troubleshooting || **[DEVELOPMENT.md](DEVELOPMENT.md)** | Instructions for contributors: setup, architecture, development workflow, adding features || **[CONTRIBUTING.md](CONTRIBUTING.md)** | Guidelines for reporting issues and submitting pull requests || **[test/README.md](test/README.md)** | How the unit and integration suites, coverage floor and benchmark app fit together || **[training/README.md](training/README.md)** | Fine-tuning the embedding model used by `get_element_locator` |
See [ANALYSIS_BSTACKDEMO.md](ANALYSIS_BSTACKDEMO.md) for a real-world example of crawl results.See [CRAWL_RESULTS.md](CRAWL_RESULTS.md) for a real-world example of multi-page crawl results.
---
3 unmodified lines
| File | Responsibility ||---|---|| `src/crawler.ts` | `SiteCrawler` β headless Chrome via Selenium, extracts DOM snapshots || `src/analyzer.ts` | `DomAnalyzer` β semantic ML scoring identifies high-risk elements via `Xenova/all-MiniLM-L6-v2` || `src/crawler.ts` | `SiteCrawler` β headless Chrome via Selenium, injects the analyzer bundle and extracts DOM snapshots || `src/analyzer.ts` | `DomAnalyzer` β runs in the page; semantic ML scoring via `Xenova/all-MiniLM-L6-v2` (`paraphrase-MiniLM-L3-v2` on low-resource devices), with heuristic fallback || `src/heuristic-scorer.ts` | Rule-based intent scoring used when the model is unavailable || `src/locator-generator.ts` | Builds stable CSS/XPath locators for scored elements || `src/semantic-matcher.ts` | `SemanticMatcher` β embedding similarity for `get_element_locator` || `src/test-case-generator.ts` | `TestCaseGenerator` β creates structured test cases from high-intent elements || `src/webmcp-semantic-tools.ts` | `SemanticToolGenerator` β auto-generates domain-specific MCP tools || `src/webmcp-semantic-handlers.ts` | `SemanticHandlerGenerator` β creates browser-side handlers for tools |1 unmodified line| `src/aria-auditor.ts` | `auditAriaSnapshot` β advisory ARIA rules; for each problem, the user impact, advice and what removing the ARIA would lose || `src/markdown-exporter.ts` | `MarkdownExporter` β formats output in multiple formats (JSON/Markdown) || `src/test-executor.ts` | `TestExecutor` β orchestrates test execution in browser context || `src/multi-page-crawler.ts` | `MultiPageCrawler` β breadth-first, same-site crawl across many pages || `src/login-handler.ts` / `src/session-manager.ts` | Detects and fills login forms; keeps credentials and cookies for a crawl || `src/workflow-detector.ts` / `src/advanced-workflow-detector.ts` / `src/journey-inference-engine.ts` | Detect user workflows across crawled pages || `src/browser-pipeline.ts` / `src/embedding-cache.ts` / `src/performance-optimizer.ts` | Browser-side analysis pipeline, embedding cache and performance tuning || `src/index.ts` | MCP server entry point; exposes three MCP tools over stdio || `src/index.ts` | MCP server entry point; exposes seven MCP tools over stdio |
Supporting directories: `benchmark/` (BenchmarkShop, the local fixture site the integration tests crawl, plus its ground-truth journeys), `test/` and `training/`.
---
## Prerequisites
- Node.js β₯ 18- Node.js β₯ 18 (CI runs 18, 20 and 22)- Google Chrome installed (Selenium Manager handles chromedriver automatically)
---5 unmodified linesQuick build variants:
```bashnpm run build # Compile TypeScriptnpm run build:browser # Compile analyzer for browser injectionnpm start # Build + start MCP servernpm run dev # Run with tsx (no build step)npm test # Run test suitesnpm run build # Compile TypeScriptnpm run build:browser # Bundle the analyzer for browser injection (build/analyzer.browser.js)npm start # Both builds, then start the MCP servernpm run dev # Run with tsx (still needs build/analyzer.browser.js from build:browser)npm test # Both builds, then unit + integration suitesnpm run test:unit # Unit suites only (no browser, no network)npm run test:coverage # Unit suites with an enforced coverage floornpm run benchmark:install # One-off: install the benchmark app needed by the integration suites```
Model fine-tuning scripts (`train:harvest`, `train:prepare`, `train:evaluate`) are described in [training/README.md](training/README.md).
---
## Environment Variables
All are optional.
| Variable | Effect ||---|---|| `WEBMCP_HEADED=1` | Show the Chrome window instead of running headless || `WEBMCP_SEMANTIC_LOCATOR=off` | `get_element_locator` uses keyword matching only (`0` and `false` also work) || `WEBMCP_LOCATOR_MODEL` | Embedding model for `get_element_locator`: a Hugging Face id or a local directory, such as a fine-tuned model || `WEBMCP_LOCATOR_MIN_SIMILARITY` | Minimum similarity for a meaning-only locator match; set it for a fine-tuned model || `HF_TOKEN` | Hugging Face token, needed only for a private `WEBMCP_LOCATOR_MODEL` |
---
## MCP Tools7 unmodified lines```json{ "url": "https://example.com", "outputFormat": "json" "format": "json", "ariaAudit": false}```
`format` is `markdown` (default), `json` or `markdown-summary`. `ariaAudit` adds the `audit_aria` advisory to the result.
**Output**: Prioritised test cases with intent scores, action types, and preconditions. See [USAGE.md](USAGE.md#crawl_and_analyze) for full documentation and examples.**Output**: Prioritised test cases with intent scores, action types, and preconditions. See [USAGE.md](USAGE.md#tool-1-crawl_and_analyze) for full documentation and examples.
### 2. `get_element_locator`
7 unmodified lines}```
Call `crawl_and_analyze` first; this tool looks up elements from the most recent crawl.
**Output**: Stable CSS or XPath locator string. See [USAGE.md](USAGE.md#get_element_locator) for examples.**Output**: Stable CSS or XPath locator string. See [USAGE.md](USAGE.md#tool-2-get_element_locator) for examples.
Elements are matched by meaning as well as by shared words, so "checkout button" can find a button labelled "Proceed to payment". This uses a local embedding model (`Xenova/all-MiniLM-L6-v2`, about 23 MB, downloaded from Hugging Face on first use). Set `WEBMCP_SEMANTIC_LOCATOR=off` to use keyword matching only. To train your own model for this, see [training/README.md](training/README.md).
### 3. `run_critical_tests`
Executes high-priority test cases (intent score β₯ 50) using auto-generated semantic tools. Tests are run directly in browser via native DOM APIs.Crawls the URL afresh, then executes its critical test cases (intent score β₯ 50) using auto-generated semantic tools. Tests are run directly in the browser via native DOM APIs.
**Input**
```json{ "url": "https://example.com", "testIds": ["test-1", "test-2"] "testIds": ["test-1", "test-2"], "retryCount": 1, "format": "json"}```
Only `url` is required. `testIds` limits the run to those tests; `retryCount` (default 0) re-runs a failing test up to that many more times; `format` is `json` (default) or `markdown`.
**Output**: Test execution results with pass/fail status and assertions. See [USAGE.md](USAGE.md#run_critical_tests) for details.**Output**: Test execution results with pass/fail status. See [USAGE.md](USAGE.md#tool-3-run_critical_tests) for details.
### 4. `audit_aria`
19 unmodified lines
Advisories where deleting the ARIA loses nothing are counted separately. See [USAGE.md](USAGE.md#tool-4-audit_aria).
### 5. `crawl_multi_page`
Crawls a site breadth-first from a start URL, staying on the same site, analyses each page, and detects user workflows across pages. With `credentials` it finds the login form and signs in before crawling protected pages.
**Input**
```json{ "startUrl": "https://example.com", "maxPages": 10, "maxDepth": 3, "workflowStrategy": "both", "credentials": { "username": "user", "password": "secret" }, "format": "json"}```
Only `startUrl` is required.
| Option | Default | Notes ||---|---|---|| `maxPages` | 10 | 2β50 || `maxDepth` | 3 | 1β5 || `pageLoadTimeout` | 30000 | ms || `scriptTimeoutMs` | 120000 | ms, Selenium async-script timeout || `analysisTimeoutMs` | 90000 | ms, in-page analyzer watchdog || `modelLoadTimeoutMs` | 5000 | ms before falling back to heuristic scoring || `detectWorkflows` | `true` | || `workflowStrategy` | `both` | `heuristic`, `ml-based` or `both` || `enableAutoLogin` | `true` | Only acts when `credentials` are given || `format` | `json` | or `markdown` |
**Output**: Per-page analysis and detected workflows, plus a `sessionId`. Sessions are kept in memory for one hour.
### 6. `get_workflow_by_name`
Returns one detected workflow from a `crawl_multi_page` session.
```json{ "sessionId": "session_β¦", "workflowName": "login_flow"}```
### 7. `export_workflow_visualization`
Exports the workflows from a `crawl_multi_page` session as Markdown, with page sequences, actions and flow diagrams.
```json{ "sessionId": "session_β¦", "workflowIds": ["β¦"], "format": "full"}```
`workflowIds` is optional (default: all). `format` is `individual`, `comparison` or `full` (default).
---
## Client Configuration7 unmodified lines}```
Replace `/path/to/project` with the absolute path to this repository.Replace `/path/to/project` with the absolute path to this repository, and run `npm run build && npm run build:browser` first: the server injects `build/analyzer.browser.js` into each page it crawls.README.md+120-19