HashLoc is a web element locator short-code and UI-change-tolerant localisaion technique based on Similo.
↓ UI v1 ↓
<input id="mail" type="email" placeholder="hci@example.com">HashLoc
C600003TG00001ASXV99MMAE26NAWK800002000EVT8Q↓ UI v2 ↓
<input id="e-mail" placeholder="hci@example.com">Find by HashLoc
{
status: "confident",
confidence: 0.984,
element: HTMLInputElement
}npm install webfuse-com/HashLocimport * as HashLoc from "@webfuse-com/hashloc";<script src="dist.browser/HashLoc.js"></script>The browser bundle exposes the API via the global
window.HashLoc.
HashLoc.encode(
element: Element,
options?: EncodeOptions
): string
HashLoc.resolve(
code: string | string[],
options?: ResolveOptions
): {
status: "confident" | "ambiguous" | "unconfident";
element: Element | null;
confidence: number;
score: number;
margin: number;
candidates: {
index: number;
element: Element | null;
score: number;
}[];
profile: string;
}Read the full API Documentation.
Requires Node.js 22 (and Python 3.10 or later for the evaluation).
npm installnpm run buildnpm run testnpm run test:<SUITE>
node --test [--test-name-pattern="<TEST-TITLE>"] "test/<SUITE>/<FILE=*>.test.js" # e.g., HashLoc.codes
| Suite | Note |
|---|---|
unit |
|
end-to-end |
DOM release simulation, training and evaluation |
eval |
Baseline ports vs Java/Scala reference (Python) |
Tests use the built-in Node.js test runner (
node:test) and run againstdist.lib: build first.
Copy the Kluge & Stocco dataset to the
/datasetdirectory.
cd eval && pip install -r requirements.txtnpm run eval:allnpm run eval:<study>
<study>∈ {accuracy,accuracy:no-spatial,decomposition,drift,crossval,sketches,ablation}
npm run eval -- --verbose --split 2 --modes 1,firstlast --profiles M
Inline Identity: Change-Tolerant Web Element Locators from Similarity Sketches
Thassilo M. Schiepanski
Surfly BV
