Skip to content
Draft, pre-release documentation

Kasm Session Runtime can reach a control in four ways. They differ in where the target comes from, and the ladder ranks them by how much to trust that source. Use the highest rung that reaches the control. Only the lowest rung needs a vision model.

The coordinate-trust ladder, most trusted at the top. Rung 0, page element: the target is the browser DOM over the Chrome DevTools Protocol, with no coordinate; key chords sit beside it. Rung 1, declared position: a fraction of the window written by the scenario author. Rung 2, accessibility: the application names the control over AT-SPI. Rung 3, vision-grounded: a model locates the described element on a screenshot and the step must carry an expect check. Rungs 0 to 2 need no model; rung 3 needs one.Most trusted, cheapestUse the highest rung that reaches the element0. Page elementThe browser’s DOM over CDP; no coordinate at allcdp_click, cdp_fill, cdp_*No model1. Declared positionA fraction of the window, written and reviewed by the authorclick center, click "<name>", click <fx> <fy>No model2. AccessibilityThe app names the control over AT-SPI and performs the actionclick_element "<name>"No model3. Vision-groundedThe model locates the description on a fresh screenshotclick_grounded "<description>" + expect:Needs a modelKey chordsBeside rung 0key "ctrl+s"Last resort
The report records the rung of every click, so a wrong declared fraction and a wrongly placed grounded click are told apart.
Rung Where the target comes from Needs a model
0. Page element The browser’s page structure. The action goes to the element itself, with no coordinate No
1. Declared position A fraction of the window’s width and height, written by the author with a screenshot in hand and reviewed like code No
2. Accessibility The application’s own list of controls. The application names the control and performs the action No
3. Located on screen A vision model looks at a fresh screenshot and says where the described element is Yes

Key chords sit beside rung 0. Where an application has a keyboard shortcut, a key chord does not depend on layout, theme or screen size, and beats any click.

Rung Scenario step Method for an agent or script
0. Page element cdp_click, cdp_fill and the other cdp_* steps dom.click, dom.fill, dom.type, dom.click_described
1. Declared position click center, click "<declared-target>", click <fx> <fy> input.click with a position you supply
2. Accessibility click_element "<name>", set_text, set_value, select a11y.action, a11y.set_text, a11y.set_value, a11y.select
3. Located on screen click_grounded "<description>", with a required expect: screen.ground, then input.click

The agent in your workspace and your own agent call the same methods. A scenario’s scripted steps pick the rung by the step they use, and the runtime does not try the next rung when one fails. The runtime’s loop, behind a goal: step, chooses from a list of named targets, accessibility names and page elements that the scenario and the runtime give it, and describes an element in words when it needs rung 3. It never supplies a coordinate or a selector. See Goal steps.

Rung 0 works in Chromium-family browsers (Chrome, Chromium, Brave, Edge, Vivaldi) over the Chrome DevTools Protocol and in Firefox over WebDriver BiDi, and only inside a page. A browser’s own toolbar, extension popups and native file dialogs are outside any page. Firefox has no accessibility tree, so its pages are addressed by selector. dom.list_interactive and dom.click_described need a Chromium-family browser.

Rung 1 reads the window’s geometry at the moment of the click, so a window that has moved or resized still gets the right pixel. A fraction outside 0 to 1 is rejected when the scenario loads.

Rung 2 works for GTK, Qt and Electron applications that publish their controls over AT-SPI. When a control offers an action, the runtime asks the application to perform it and no coordinate is involved. When a control offers only a position, the runtime clicks the centre of the rectangle the application reports, which is less reliable. A scenario step can ask the application what state a control is in afterwards (expect_state), with no screenshot and no model.

Rung 3 is the last resort. The runtime captures the screen, asks the model where the description is, clicks there and asks the model to confirm the expected change. If the change is absent, it locates the element again and clicks only if the new position differs, so it never repeats a click in the same place. If the model cannot confirm, the click is recorded as unverified with a concern. With no vision model configured, a scripted click_grounded step ends the run as test-error. See Vision models.

Every step row in report.json records the backend that ran it: cdp, bidi, atspi, xtest, vision, shell, rpc or none. A click also records its rung (center, declared, literal, element, grounded) and the pixels it resolved to. A wrong declared fraction means the scenario needs fixing, and a wrong located click means the model placed it badly. Runs that locate elements on screen add a grounding block with what was asked for, where the model put it and whether the click was verified.