feat(core): load element XPath maps in aiAct - #2933
Draft
quanruzhuoxiu wants to merge 7 commits into
Draft
Conversation
Deploying midscene with
|
| Latest commit: |
9f0ebf3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f4b65cc4.midscene.pages.dev |
| Branch Preview URL: | https://feat-ai-act-load-element-xpa.midscene.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loadElementXpathstoaiActfor loading name-to-XPath maps from YAML{ description, rect, center }API
Cross-scene small-model evidence
The final benchmark uses
qwen3-vl-8b-instruct, retry0,deepThink: false,cacheable: false, and identical pages/prompts between arms. It covers four DOM-backed hard-page archetypes plus a Canvas boundary case:The formal matrix contains 18 targets × 3 rounds × 2 arms = 108 physical runs. All 108 produced valid comparison evidence.
Paired outcomes were 15 baseline-failure → Map-success, 33 both-success, 0 reverse regressions, and 0 both-failure (two-sided exact McNemar p = 0.000061). Every mapped success recorded
hitBy.from = User expected path, the exact expected XPath, and one exact DOM event.The six Canvas Map runs recorded
xpathHits = 0andaiLocateUsages = 1; they are retained as a negative boundary and are not attributed to XPath.Validation
pnpm run lintpnpm --filter @midscene/core exec vitest --run tests/unit-test/element-xpaths.test.ts(5 passed)pnpm exec nx test @midscene/core(127 files; 1387 passed, 8 skipped)pnpm exec nx build @midscene/coreAI_TEST_TYPE=web ... vitest --run tests/ai/web/puppeteer/element-xpath-complex-benchmark.test.ts(108 independent model runs)The AI benchmarks are gated and skip unless their explicit benchmark variant is selected.
Experiment document
Published evidence