Docs · Release notes

Release notes

Every published Motus release, newest first. The same notes live on GitHub releases, where each release also carries its downloadable assets.

v1.1.0

LatestView on GitHub

This release is about two things: an MCP server that an agent can work with rather than around, and a browser that stays put. The server now hands an agent a snapshot a third the size it was, says what each action changed, takes a selector anywhere it took a ref, folds frames into the page, and ships a catalog that carries only what a session asks for. Underneath, a Chromium browser Motus starts on macOS or Linux is driven over a pipe and cannot outlive the process that started it, a killed test run no longer leaves browsers behind, and a cross-origin frame no longer vanishes when the browser moves it between processes. Four defects found while writing the docs are fixed too: a context route never reached a tab that was already open, every trace came out empty, a page-level role= selector threw, and the alt-text rule never fired on Chromium. Fourteen behavior changes are called out below; each would otherwise read as a regression.

A coming release will drop .NET 8

.NET 8 leaves Microsoft support on November 10, 2026, and .NET 9 ends the same day, so the library, the motus command line tool, and the test framework packages will move to .NET 10 ahead of that date. Nothing changes in this release: every package still ships a .NET 8 build beside its .NET 10 build, and a suite on .NET 8 keeps running. Installing the .NET 10 SDK now means the switch will pass unnoticed when it comes.

Browser reliability

  • A browser Motus starts on Unix cannot outlive it - A Chromium browser launched on macOS or Linux is driven over --remote-debugging-pipe rather than a debugging port. The pipe carries a liveness signal a port does not: the browser exits when its end closes, so a test host that is killed outright, SIGKILL included, takes its browser with it. There is no endpoint to discover and nothing to poll. Firefox has no pipe mode and Windows has no way to hand a child a file descriptor, so both keep the port, and a browser you attach to always uses a WebSocket.
  • Signal handlers that actually run - HandleSIGINT and HandleSIGTERM were wired to ProcessExit and CancelKeyPress, neither of which fires for a signal on Unix, so the browser they promised to close was left running by every Ctrl+C and every kill. They are now real signal registrations, and HandleSIGTERM covers SIGHUP as well because a closed terminal ends a process the same way. The handler closes the browser and waits up to five seconds before ending it outright, and none of the signals is cancelled, so the process still ends the way it always did, only with the browser gone first. On Windows, a job object ends the browser when the host's handles close.
  • A cross-origin frame survives a process swap - The browser announces a frame it moves into another renderer as a detach with the reason swap, and says the same for a document it puts into the back-forward cache. Both were treated as the frame going away, so a frame handle went dead and the frame dropped out of page.Frames at a moment chosen by the browser, which is what made the first test against a cross-origin iframe skip or fail for no reason it could name. A swap now keeps the frame, a real removal still removes it, and a frame committing a new document drops the frames it hosted, since the new document reports its own. Frame events are read from one ordered channel per session so the rule sees them in wire order.
  • Frames come in attach order - IFrame.ChildFrames and frame_list promised document order and delivered whatever a dictionary returned. They now keep the order frames attached in, which is the order they appear in the page unless the page inserted one later, and a frame the browser moves into its own process keeps its place.
  • A connect timeout says which stage was waiting - ConnectAsync bounds three stages out of its one budget and names the one that ran out: the debugging endpoint never answered with a WebSocket URL, along with what the last attempt to reach it said; it named a URL and that WebSocket never finished opening; or the socket opened and the browser never finished reporting its version and handing over its tabs. A refused connection, a name that will not resolve, and something else listening on the port all looked the same before.
  • Timeouts reach typing, key presses, and select - KeyboardTypeOptions and KeyboardPressOptions gain a Timeout, ILocator.SelectOptionAsync gains an overload taking one, and Filter honors the timeout it is given. A configured action timeout now applies to the whole action surface rather than to clicks and fills alone, which is what lets motus mcp --timeout reach type, press, and select_option.
  • Popups are tracked wherever they open - A tab opened by window.open or a target="_blank" link is a page of the context that opened it, for a browser Motus started as well as one it attached to. context.Pages lists it, IPage.Popup fires on the opener with a page that is ready to drive, and the tab takes the context's viewport, user agent, and recording. Attaching with adoption turned off narrows what is taken over, not what is watched: a popup in a context you created is still tracked, while tabs belonging to whoever else is using the browser stay out of it.

MCP server: what the agent sees

  • A snapshot says each thing once - The browser's tree carries every label three times, as the element, the static text inside it, and the inline text box that text is laid out in, and every one of them took a ref, layout wrappers and list bullets included. On the Wikipedia article on WCAG that came to 275,000 characters and 3,015 refs. The serializer now prints the element alone, folds text into the element it names or prints it inline after a colon, drops layout-only nodes, lets an unnamed wrapper with one child step aside for it, and hands refs only to nodes worth targeting: interactive roles, named nodes, focusable nodes, and iframes. The same article is now 114,000 characters and 866 refs, which is less than Playwright's MCP server produces for the same page. Headings show [level=N] and links show [url=...], both missing before, and a name containing a quote is escaped rather than printed as is. audit_accessibility follows the same rule: a violation on a node the snapshot gave no ref, such as an image with no alt text, reports ref as null and identifies the node by nodeRole, nodeName, the new nodeText, and selector.
  • Frames are part of the page - An iframe whose content could be read prints [frame=N] and its content directly underneath, nested as deep as the page nests them. Refs inside carry the frame's index as a prefix, so f1e2 is the second addressable element of frame 1, and passing it to click or type acts inside the frame with nothing selected first. Ten frames are read by default and max_frames on snapshot changes that; past the limit, and for a frame that is hidden or unreadable, the snapshot says how many were left out and points at frame_list and frame_select, which still scope the session to one frame when that is the better shape.
  • An action says what it changed - Every action came back as one line, Clicked e16, whether the click had done nothing at all or had opened a tab, logged an error, thrown an uncaught exception and navigated the page out from under the refs the agent was holding. Finding out which took a snapshot, a console_messages and a tab_list. An action result now carries a short block under its first line, and only the rows that apply: where the page ended up and what it calls itself when either changed, a tab the page opened with the index tab_select takes, how many errors and uncaught page errors the action logged along with the cursor that reads exactly those, a dialog it left open, and a line saying the refs from the last snapshot no longer address the page when the action navigated it. A click on a quiet page is still one line. Because the browser accepts a click before it has followed the link, the result waits half a second for the page to show what happened, and --settle sets that wait. click, type, press, select_option, set_checked, navigate, reload, go_back and go_forward also take snapshot: true, which appends a fresh snapshot to the result, and navigate names the page it landed on by title rather than only the URL it was given.
  • A selector works anywhere a ref does - Every tool that takes a ref now takes a selector in its place: CSS by default, or prefixed with xpath=, text=, role=, or data-testid=. A ref is a name the last snapshot handed out, so it is only as current as that snapshot; a selector describes the element itself and needs no snapshot at all. That is the way back when refs have gone stale after a navigation, and the shorter way in when the element is already known by a stable selector. Anything shaped like a ref is still read as one, so a ref the latest snapshot no longer holds comes back as a stale ref rather than as a selector that matched nothing, and a selector is searched in the frame selected at the time of the call.
  • click can use the other mouse buttons - It takes button (left, right, middle) and modifiers (Alt, Control, Meta, Shift), so a context menu or a ctrl-click reaches an element by ref or selector rather than only by coordinate. Both run the same visible, enabled, settled and receiving-events checks as a plain click. A double-click stays left-button only, and says so rather than quietly dropping the button.
  • A dialog no longer stops the session for a minute - Clicking a button whose handler calls alert() used to hang for a full minute and then fail with A task was canceled., which said nothing about a dialog. The browser stops answering input the moment a dialog goes up, so the command that dispatched the click was left unanswered until the transport gave up on it. Every action now runs against the dialog event: the moment one opens, the call returns The action opened an alert dialog: "Are you sure?". Call handle_dialog to accept or dismiss it. Results from later calls say a dialog is open until it is answered, an action asked for while one is open is refused straight away rather than dispatched into a page that cannot receive it, and --dialogs accept or --dialogs dismiss answers them without the round trip.
  • One request in full - network_request takes the sequence number network_requests prints in front of each line and returns what the log holds for that request: the method, status, URL and resource type, the request and response headers, the request body, and the response body when the browser can still produce it. Headers are copied when the request is logged; the body is fetched only when it is asked for, because a page that downloads a file would otherwise keep the file in the server's memory for as long as the log held the entry. The browser drops response data on a navigation, so a request from a document the page has left says the body is gone rather than inventing one.
  • Tabs are numbered across contexts - tab_list covers every tab the session has open, whichever context it is in, and names the context on each row once more than one is open. tab_select and tab_close take those numbers and move the session to the tab's context when they have to, so a tab that can be seen can be worked in without naming its context first. tab_open still follows the active context, so context_select decides where a new tab goes.
  • Errors say what happened - A missing argument is reported as The 'ref' argument is required., naming the field the caller left out, rather than Value cannot be null. (Parameter 'key'), which named a dictionary inside the server. Every tool checks the arguments it cannot work without before it touches the browser. A cancellation that reaches a tool is reported as a timeout that says how long it waited and what it was waiting for, instead of A task was canceled.

MCP server: what the operator controls

  • A catalog that carries what the session needs - The default catalog is 34 tools, down from 55, and a third smaller in the schema an agent reads at every turn. Coordinate input (click_xy, hover_xy, move_xy, scroll_xy, drag, resize), recording (trace_*, har_*, video_*), isolated contexts (context_*), and request mocking (route_*, unroute) are named with --caps coordinates,recording,contexts,routing, repeated or comma-separated, with MOTUS_MCP_CAPS in the environment or mcp.caps in motus.config.json as the other two ways in. The flag wins over the variable and the variable over the file. Naming a group only adds; the always-available tools are there whatever it says.
  • The browser the server starts is configurable - motus mcp now carries the launch and context settings an agent session needs to match the machine it runs on: --browser-arg (repeatable, and --browser-arg=--no-sandbox is what a container running as root needs before Chromium will start at all), --executable-path, --user-data-dir, --storage-state, --proxy-server and --proxy-bypass, --user-agent, --locale, --timezone, --timeout and --navigation-timeout, --settle, --dialogs, and --config to take defaults from a motus.config.json that already exists rather than restating them on the command line. --channel is honored for the first time: it was read only to look up a browser motus install had downloaded, and the options the browser was actually started with never carried it, so --channel firefox on a machine without Firefox started Chromium instead and the session went on describing itself as Firefox. A channel that was named and cannot be found now stops the server and says which install command to run, with --executable-path as the way past it.
  • Boundaries an agent cannot talk its way past - Files are written inside one output directory and read from the roots the MCP client reports, file:// URLs are refused, and browser_attach is advertised only when the operator allowed it. Each is a behavior change and is spelled out below. --allow-unrestricted-file-access restores the old file behavior for anyone who was relying on it.

Fixes

  • A context route reaches a tab that was already open - context.RouteAsync copied the rule to every open page, but the page-level bookkeeping decided the browser's request interception was already on because the context rule existed, so it never turned it on. A mock registered after the page opened was silently ignored until the next page. Interception state is now owned by the page's network layer behind a gate and enabled from the real state rather than a rule count, so a context rule applies to every open page from its next request onward, and to every page opened later from its first.
  • Traces have events in them - Tracing.StopAsync wrote a ZIP holding an empty trace.json, every time, headless or headed, and motus trace show reported "No actions recorded". The browser returns a streamed trace as one JSON object holding a traceEvents array, sometimes gzip-compressed, and the reader accepted only a bare array and parsed each chunk of the stream on its own. Chunks are now accumulated and the payload read in either shape, compressed or not. The viewer and the screenshot extractor also read a trace event's categories as the comma-separated list they are, so an event carrying more than one category is no longer skipped.
  • page.Locator("role=button") works - A page-level role selector threw Either nodeId, backendNodeId or objectId must be specified, because the accessibility query was sent with no root when nothing narrower than the page was asked for. It is now rooted at the page's document like every other strategy. page.GetByRole was never affected, which is why the samples did not catch it; the MCP role= selector prefix was.
  • The alt-text rule fires on Chromium - a11y-alt-text matched the role img, and Chromium reports image, so an image with no accessible name was never reported. Both spellings are accepted, in the color-contrast rule's list of non-text roles as well.
  • Deep descendants stay in the accessibility tree - Building the tree copied nodes as it wired children, so a node several levels down could be dropped from its parent chain. Each node's own child list is populated now, and a nested main, region, article structure keeps every heading and button under the element that holds it.

Documentation

  • MCP guide - New Request mocking and isolated contexts sections with screenshots, the parameters that were missing from type, click, screenshot, evaluate, audit_accessibility, generate_pom, trace_start, and wait_for_element, the attach case in crash recovery, the HTTP transport's idle timeout, and the full option table including --caps and --settle.
  • Network interception describes what the code does - The guide claimed * stopped at a path separator and the first matching handler won. A pattern is an exact match, a glob that must cover the whole URL with * crossing /, or a plain substring; the most recently registered matching handler runs; one handler takes a request and nothing falls through; and a brace list such as {png,jpg} is literal text, so the old samples matched nothing. The samples are rewritten to patterns that match.
  • Getting started and the migration guides - Mouse buttons and modifier clicks, per-call timeouts, and a callout on popups, with the Playwright and Selenium tables mapping the new click and select overloads. The transport paragraphs no longer say WebSocket everywhere.
  • Architecture - Browser lifecycle covers the pipe, the signal handlers, the Windows job object, the three connect stages, and a new section on popups and new tabs; Transport and protocol covers CdpPipeSocket beside the WebSocket. Frames and iframes gains the process swap trap.
  • Pictures - Eight screenshots across getting started, accessibility, configuration, flaky tests, network interception, browser lifecycle, and the MCP guide, most taken with Motus.
  • Housekeeping - Line endings are normalized to LF for the files that predated the .gitattributes rule, so a diff against 1.0.15 looks larger than it is. The README describes the pipe transport, --caps, and attaching, and its command list matches the CLI again.

Behavior changes

  • MCP: the default catalog is smaller - A client that ran plain motus mcp and used click_xy, drag, resize, the context_* tools, the route_* tools, or trace, HAR, and video recording will find them gone until its command line names the group with --caps. The 34 tools that remain need no option and cannot be turned off.
  • MCP: browser_attach needs an option - The tool connected the session to any debugging endpoint the agent named, which on a machine running a debug-enabled browser meant moving into somebody's signed-in sessions on the agent's own initiative. It is now in the catalog only when the server was started with --allow-attach, or with --connect, which implies it, and refuses the call if it is ever reached without one. Sessions started with --connect are unaffected.
  • MCP: artifacts are written inside an output directory - trace_stop, har_stop and video_start took any path the agent handed them and wrote there, and upload_files read any file on the machine. Paths are now resolved inside one output directory, a directory for this run under the temporary directory unless --output-dir names another, and an absolute path, a path that climbs out with .., or one that follows a symbolic link out is refused. Reads are confined to the roots the MCP client reported, or to the working directory and the output directory when it reports none. The directory is printed to standard error at startup and every result that writes a file echoes the absolute path. Under --http every session shares the one directory. --allow-unrestricted-file-access restores the old behavior.
  • MCP: file:// URLs are refused - navigate, tab_open and the route tools no longer open a local file, including through a redirect a mock sets up. An agent reads back whatever it navigates to, so a page that talks it into a file: URL was reading the machine's files through snapshot and evaluate. Anything with no scheme is still treated the way a typed address would be. --allow-unrestricted-file-access enables it again.
  • MCP: the console and network logs no longer empty themselves when they are read - console_messages and network_requests cleared their buffer on every read, so a reply that failed on its way to the agent took the entries with it, a retry found nothing, and two readers took entries from each other. Every entry now carries a sequence number and stays until the 250-entry buffer pushes it out. Both tools take since, a sequence number to read from, and both end with a next=N line to pass back as the next since; a read that misses entries the buffer has already dropped says how many. A client that reads without since now gets everything the buffer holds rather than only what arrived since its last call, so a client that polled in a loop should start passing the cursor.
  • MCP: tab numbers span contexts - tab_list used to number the active context's tabs from one; it now numbers every open tab in one sequence across contexts. A client that held a tab index across a context_select will find it points at a different tab.
  • MCP: a snapshot on a browser without an accessibility tree says which browser is the problem - Refs come from the accessibility tree, which is read over the Chrome DevTools Protocol, so a Firefox session had no tree to render. The empty result was read as a page with nothing addressable in it and answered with the note about canvas-drawn interfaces, which sent the agent looking at the page for a problem that belonged to the browser. The snapshot now states the limitation and points at the coordinate tools, which work either way.
  • AccessibilitySnapshotAsync nests a descendant of an ignored node under its nearest surviving ancestor - Browsers mark a great many wrapper elements as ignored, and the tree was built by skipping those nodes outright, which left everything beneath them attached to nothing. Those stranded subtrees were promoted to the top level, so a form inside a stack of layout divs came back beside main rather than inside it, and banner and main came back as siblings of the document rather than its children. Descendants of an ignored node now take that node's place in its parent's child list, and Roots is normally the document alone. Code that walked Roots expecting orphaned subtrees at the top level will find them in place instead. Both readers of the tree change with it: the MCP snapshot tool, and accessibility audits, which now report the element's real position in the page.
  • A page Motus did not open can now appear in context.Pages - Motus watched what opened in a browser only while attached to one it did not start. A browser Motus started now watches too, so context.Pages, the context's Page event, IPage.Popup and the page lifecycle hooks all report tabs the page opened for itself rather than only the ones that were asked for. Code that assumed a context holds exactly the pages it created, or that counted pages to decide which one to act on, will see the extra tab. Tabs in browser contexts Motus never created are still ignored for a browser Motus started, so the window the browser opens for itself is not one of them.
  • A context route applies to pages that are already open - A rule registered on the context after a page was opened used to be ignored on that page for good. It now applies from the page's next request. A test that registered a mock, opened nothing new, and relied on the live server answering anyway will start getting the mock.
  • Tracing.StopAsync fails rather than writing an empty trace - A trace payload that cannot be read now throws MotusProtocolException naming the read that failed, where before it produced a ZIP with no events and nothing said otherwise. Anything that treated a 122-byte trace as success will now see the error, which is the right outcome; the sample test that only checked the file existed has been tightened for the same reason.
  • a11y-alt-text reports images on Chromium - The rule never fired there, so a suite asserting ToPassAccessibilityAuditAsync against a page with an unnamed image passed. It will fail now, and the audit hook in warn mode will print violations it never printed. Add alt text, or skip the rule with SkipRules("a11y-alt-text") while that is done.
  • A page-level role= selector returns matches instead of throwing - Code that caught MotusProtocolException around page.Locator("role=...") as a workaround can stop; a selector that matches nothing returns an empty result like any other.
  • A launched Chromium on Unix exits with the process - A test host that was killed, or that ended on a signal, used to leave its browser running with a motus-profile- directory behind it. Both are gone now. A context Motus creates in a browser it started is no longer marked to dispose itself when the connection detaches, because a browser that answers a detach by disposing contexts does not also act on the pipe closing and would sit idle with nothing left in it; that is only visible to code that called DisconnectAsync on a launched browser and expected its contexts to have been disposed in the browser.

Contracts

ILocator gains ClickAsync(MouseButtonOptions, double?) and SelectOptionAsync(string[], double?), and KeyboardTypeOptions and KeyboardPressOptions gain a Timeout. These are additive for callers and breaking for anyone implementing ILocator, which in practice means test doubles. Nothing else in Motus.Abstractions changed shape.

v1.0.15

View on GitHub

Motus can now drive a browser it did not start, reach into frames the browser renders in their own process, split a suite across CI agents and merge the results back together, and tell a flaky test from a broken one. Alongside those: an on-screen cursor so screenshots and recordings show where the pointer actually went, automatic recovery when a browser dies mid-run, a pinned-browser workflow for reproducible CI, and IntelliSense documentation in every package. Six behavior changes are called out below; each would otherwise read as a regression.

Attaching and frames

  • Attach to a running browser - MotusLauncher.ConnectAsync takes either the CDP WebSocket URL or the HTTP debugging endpoint (http://127.0.0.1:9222) and adopts what is already open, so browser.Contexts and context.Pages are populated when it returns, with no further call. Targets that appear or disappear afterwards are tracked, so a long-lived session stays accurate instead of describing a snapshot. ConnectOptions carries AdoptExistingTargets, SlowMo, and a Timeout that bounds the whole connect, because an endpoint that accepts a connection and then answers nothing would otherwise hold the caller for good. This makes a signed-in profile, a warm browser reused between runs, a browser shared with the person sitting in front of it, and a Chromium-based desktop application all drivable.
  • Ownership is real and observable - IBrowser.OwnsProcess reports whether Motus started the browser, and DisconnectAsync ends a connection without ever ending a process, including for a browser Motus did start. Adopted contexts are never disposed in the browser, and adopted pages are released rather than closed, so windows belonging to whoever was using the browser survive.
  • Frames the browser renders in their own process - A cross-origin frame is now in page.Frames and in its parent's ChildFrames, with the right parent and children, and a frame nested inside one is reachable too: auto-attach is armed recursively, so nesting depth is not a limit. Locators, clicks, evaluation, navigation, and script injection all route to the session that owns the frame. None of this is visible in the API; an out-of-process frame is an ordinary IFrame.
  • Execution worlds - IFrame.EvaluateAsync gains an overload taking EvaluateOptions { World = ExecutionWorld.Isolated }, which runs against the frame's document without seeing or disturbing the page's globals. Useful in a page whose scripts have replaced built-ins. The main world stays the default, since reading application state is the common case and an isolated world is exactly where that state is not visible.
  • Frame lifecycle events - IPage gains FrameAttached, FrameNavigated, and FrameDetached, and IFrame gains IsDetached, so a held frame handle answers rather than failing obscurely three calls later.
  • MCP: drive a browser that is already running - motus mcp --connect <endpoint> starts the server attached, and the new browser_attach tool attaches at any point during a session, which is what to use when the endpoint is not known at the time the MCP client is configured. browser_status reports which browser is being driven and whether the server started it. An attached session adopts the browser's existing context rather than opening one beside it, and leaves the browser running on shutdown.
  • MCP: look inside frames - frame_list and frame_select scope the session to one frame, the same way tab_select and context_select work, so a frame is addressable state rather than an argument repeated on every call. Scope covers snapshot, evaluate, and the wait_for text conditions; every interaction tool follows through the refs a scoped snapshot hands out. A page snapshot now says how many frames its tree does not describe, so an agent that finds an empty-looking iframe is pointed at frame_list rather than concluding the content is missing.

Running suites at scale

  • Sharding across agents - motus run --shard <index>/<total> runs a deterministic slice of the suite, 1-based, so a suite splits across CI agents without any agent needing to know what the others took. motus shard merge <files> --output junit:<path> reads the per-shard JUnit and TRX results back and writes one aggregate report, summing the buckets and validating that every shard reported; repeat --output for more than one format. --expect <n> makes a missing shard an error rather than a quietly smaller total, which is the failure worth catching: a shard that never ran otherwise looks like a suite that passed. Shard coordinates are stamped into the reports and flow through TestSuiteInfo.
  • Flaky tests and quarantine - --retries and --retry-policy distinguish a retry for a transient fault from a retry that is hunting flakiness: transient, the default, re-runs only CDP disconnects, while flake re-runs any failure and marks a test that then passes as flaky rather than green. --fail-on-flaky decides whether that gates the run; by default a flaky test passes it with a warning. Quarantine keeps a known-bad test running and reported while stopping it from failing the build, which is the alternative to deleting it and forgetting it: [Quarantine] marks a test or class in code, and --quarantine <file> takes a list of fully qualified names instead, for quarantining without touching the source. --flaky-history <file> accumulates per-test run, failure, and flake counts into a JSON file across runs, merging with what is already there and tolerating a corrupt one, so flakiness can be seen as a trend instead of a single bad morning. Console, HTML, JUnit and TRX reporters all surface flaky and quarantined status.
  • MSTest retries a test that lost its browser - [MotusTestClass] and [MotusTestMethod] re-run a test when the browser disconnects underneath it, while leaving assertion failures strictly alone. A browser dying is not a test result, and before this it was reported as one.

Surviving a browser that dies

  • Automatic recovery - A crashed or unhealthy browser is detected, disposed, and replaced with a fresh one rather than poisoning every test after it. Pages cached against the dead browser are invalidated by a generation counter, so a stale handle resolves against the replacement instead of failing.
  • Browser output no longer blocks the browser - Redirected stdout and stderr are drained continuously, so a pipe nobody reads can no longer fill and wedge the browser. The retained tail is attached to timeout messages, which turns "the endpoint never answered" into a message that says why.
  • Shutdown is bounded and does not race - Closing waits and then kills, disposal cannot double-close, fixture handover is bounded by a timeout, and contexts created during a failed attempt are closed rather than leaking a fixture slot.

Reproducible browsers

  • Pin the browser - motus install accepts an exact Chromium revision, and launch.executablePath in motus.config.json or MOTUS_EXECUTABLE_PATH in the environment points at a specific binary. A path passed in code still wins, so the precedence is explicit rather than surprising. Pinning is what makes a CI run reproducible when the stable channel moves underneath it.
  • Windows sandbox access - Chromium unzipped into a user directory is granted the ACLs its sandbox needs, during install and when repairing an existing install. A failure is reported without aborting the install.

Seeing what the automation did

  • On-screen cursor and natural mouse motion - ContextOptions.ShowCursor draws a pseudo-cursor and click effects into the page, so a screenshot or a recording shows where the pointer was and when it clicked, which is otherwise invisible. NaturalMouseMotion moves in eased multi-step paths rather than teleporting, which both looks right in a recording and satisfies pages that require observed movement. --show-cursor and --natural-mouse expose both to the MCP server, and --show-cursor turns on natural motion by default since a cursor that teleports is worse than none.
  • Recordings play back at the right speed - The recorder measures the rate it actually captured at and patches the AVI timing headers when finalizing, so playback matches real time instead of drifting from the nominal frame rate.

Documentation

  • Packages ship IntelliSense - The assertion and reporter APIs (Expect, LocatorAssertions, PageAssertions, ResponseAssertions, ReporterCollection) are documented, and the four Motus.Testing packages now generate XML documentation at all. Assertions are the most-used surface in the library and had none of this, so the entry point every test goes through was undocumented in the editor.
  • Four new guides - Attaching to a Running Browser covers debugging endpoints, ownership, CI and container patterns, signed-in profiles, desktop applications, and the security implications in full. Frames and iframes covers traversal, out-of-process frames, execution worlds, and two traps that cost real time to rediscover. Sharding covers partitioning, merging, and the missing-shard failure that looks like a passing run. Flaky Tests and Quarantine covers retry policies, what counts as flaky, quarantine, and flake history.
  • A CLI reference on the site - Every command, argument, option, default and exit code now has a page of its own at CLI Reference. Twelve commands, including the three that were previously documented nowhere at all: trx show, shard merge and check-selectors. The package README, which had been the only listing and had drifted from the tool it described, now points at it rather than repeating it.
  • Existing guides caught up - The Playwright migration guide maps connectOverCDP and frameLocator by name. Configuration documents the flaky, shard and coverage sections, launch.executablePath, and eleven environment variables that were previously undocumented. The coverage section covers where thresholds may be set and the two cases that silently yield no data. Test framework integration covers retrying a test that lost its browser, browser lifecycle covers pinning an exact browser revision, and the MCP guide covers the new evaluate result shape along with the cursor, viewport and recovery options.

Behavior changes

  • CloseAsync no longer ends a browser Motus did not start - This was a defect: closing an attached browser sent Browser.close and terminated a process belonging to somebody else. It now closes the contexts Motus created and disconnects. If you were relying on CloseAsync to end a browser you connected to, end the process yourself; DisposeAsync will not do it either, and never did.
  • A locator from IFrame now resolves inside that frame - frame.Locator(...) and the GetBy* factories beside it previously built a page-rooted locator and resolved against the main frame regardless of which frame was asked. Any test that leaned on that fall-through will start failing, and the failure will look like a regression when it is the fix. Use page.Locator(...) where the main frame was what you actually wanted.
  • ILocator.BoundingBoxAsync answers in page coordinates for a frame-rooted locator - It previously measured in the frame's own coordinate space, so a box handed to page.Mouse missed by the frame's offset. Code that was correcting for that offset by hand should stop.
  • IPage.ScreenshotAsync honors ScreenshotOptions.Clip - The clip was accepted and then dropped, so a caller asking for a region was handed the whole viewport and nothing said otherwise. It now captures the region asked for. Anyone who set a clip and relied on getting the full viewport back will see a different image, and anyone who set one and wondered why it did nothing will see it work.
  • An assertion that lost the browser now reports the loss rather than a failure - A retrying assertion treats the target going away as something to poll through, because during a navigation the old execution context dies and the next attempt succeeds against the new one. When the browser itself is gone no attempt ever succeeds, so the assertion ran out its timeout and reported Received: <not evaluated>: a verdict about the page stated by a test that never reached one. Worse, it hid the loss from BrowserFailure.IsBrowserLost, which is exactly what [MotusTestClass] and --retry-policy transient ask before re-running, so the one failure worth retrying was the one they could not see. An assertion that never evaluated and ended with the target closed now propagates that instead. Assertions that fail on their merits, and elements that are simply absent, are unchanged. Code catching MotusAssertionException around an assertion will see MotusTargetClosedException in this case.
  • MCP: evaluate returns its value under a result key - Structured content has to be a JSON object, so an expression returning a bare number, string, or array was rejected by the client before the model ever saw it, and the workaround was to wrap the expression by hand. Every value now comes back as {"result": ...} whatever its shape. Clients that were reading the value directly need to read result; expressions that were wrapped by hand can stop.
  • MCP: a nullable tool parameter is no longer advertised as required - Twenty of the tools declared parameters that accept null and required them at the same time, so a client that sensibly omitted one got an argument error rather than the documented default. Those parameters are now optional and carry their default in the schema. Clients that were passing explicit nulls are unaffected.

Two of these were found by the exit criteria for the frame work rather than reported, and both predate it: the frame-rooted actionability checks and the bounding-box space were wrong for every frame locator, not only cross-origin ones.

Contracts

IFrame gains IsDetached, AccessibilitySnapshotAsync, LocatorByBackendNodeId, and an EvaluateAsync overload; IPage gains three frame events; IBrowser gains OwnsProcess and DisconnectAsync. TestResult and TestRunSummary gain Flaky, Quarantined and Attempts, and TestSuiteInfo gains ShardIndex and ShardTotal. These are additive for callers and breaking for anyone implementing the interfaces or constructing those records positionally, which in practice means test doubles and custom reporters.

v1.0.14

View on GitHub

Motus's MCP server can now drive interfaces that the accessibility tree cannot see, and record what it does. A new set of coordinate tools gives agents trusted pointer input at exact viewport positions, the escape hatch for canvases, maps, editors, and other custom-rendered surfaces, while page video recording captures a session to a file with no external dependencies. Both arrive alongside viewport control for the whole session and quality-of-life fixes for uploads and tool discovery.

Improvements

  • Coordinate input tools - Six new tools (click_xy, hover_xy, move_xy, scroll_xy, drag, resize) interact at exact viewport coordinates with trusted browser input, so the browser's native hit testing decides what receives the event. Clicks support double-click, button choice, and modifier keys (Alt, Control, Meta, Shift); drag presses, emits intermediate moves, and releases, since drag libraries commonly require observed movement, and it accepts snapshot refs or raw coordinates for either end.
  • Snapshots hint at the coordinate workflow - When a page renders to a <canvas> or similar surface and exposes no addressable nodes, snapshot now says so explicitly and points to the coordinate tools, where perception shifts from the element tree to screenshots.
  • Page video recording - video_start and video_stop record the active page, following the same convention as traces and HARs: stopping finalizes the file and returns its path, and an omitted path is auto-generated under the temporary directory. Capture runs at the viewport's resolution and the output is MJPEG in an AVI container, written without external dependencies; most players open it directly, and ffmpeg converts it when another format is needed.
  • Session-wide recording with --record-video - Launch the server with --record-video <dir> and every page records for its whole life, one file per page, finalized when the page closes. No per-page tool calls required.
  • Viewport control - A new --viewport WIDTHxHEIGHT option sets the page size for the whole session (default 1280x800), headed windows are sized to match, and the resize tool changes the viewport mid-session when controls sit at or beyond its edge.
  • Engine API: video and modifier keys - The library gains IPage.StartVideoRecordingAsync/StopVideoRecordingAsync for programmatic recording, and mouse click and move options now carry modifier keys through CDP, so tests can hold Shift or Control during pointer input.
  • More reliable file uploads - Upload payloads are staged in per-page temporary directories that live until the page is disposed, so files passed to upload_files remain valid for the duration of the page that received them.
  • Setup troubleshooting - The MCP server guide now covers launch failures caused by the .NET global tools directory missing from PATH, including verifying with which motus and registering the server with an absolute path (claude mcp add motus -- "$HOME/.dotnet/tools/motus" mcp).

Sponsors

Thanks to @fluentfoundation and @fiVISION for supporting this project.

v1.0.13

View on GitHub

Motus now ships a Model Context Protocol (MCP) server, so AI agents can drive a real browser through the same engine that runs your tests. The server is a new verb on the CLI — motus mcp — and exposes browser control, page observability, and Motus's testing telemetry as a set of agent tools. Agents perceive a page through its accessibility tree rather than screenshots, addressing elements by stable reference, and the server runs over local stdio or a secured HTTP endpoint for hosted and CI use.

Improvements

  • MCP server via motus mcp - Register it with one command: claude mcp add motus -- motus mcp. Once Motus.Cli is installed as a global tool and a browser is available (motus install), any MCP client — Claude Code, Claude Desktop, or anything that speaks the protocol — can launch it. There is no separate download; the server is a verb on the existing CLI, and it advertises more than forty tools spanning everything below.
  • Navigate, snapshot, and act on a page - Core tools to navigate, take an accessibility snapshot, click, type, and screenshot. Each snapshot returns a compact, labeled element tree where every node carries a stable reference, so agents target elements by that reference instead of brittle CSS or XPath.
  • A complete interaction set - Beyond click and type: hover, key presses, dropdown selection, checkboxes, focus, clearing fields, scrolling elements into view, file uploads, and explicit waits for an element or a condition.
  • Multiple tabs and isolated contexts - Open, list, switch, and close tabs, and create isolated browser contexts so an agent can work across several independent sessions at once.
  • Page utilities, scripting, and dialogs - History navigation (back, forward, reload), arbitrary JavaScript evaluation against the page, and dialog handling for alerts, confirms, and prompts.
  • Network and console visibility - Mock, fulfill, abort, and continue requests, list active routes, inspect recent network traffic, and read console messages and page errors — the same interception engine the test framework uses.
  • Testing-grade telemetry - What sets this apart from browser-only automation: an accessibility audit tool that runs Motus's built-in WCAG rules, and a performance tool that reports Core Web Vitals (LCP, FCP, TTFB, CLS, INP) alongside heap and DOM-node metrics.
  • Recording and code generation - Generate a Page Object Model class from the current page, and capture traces and HAR archives for later inspection.
  • Remote access over HTTP - In addition to local stdio, the server runs over Streamable HTTP for hosted, team, and CI use, including the Anthropic API's MCP connector. Each client gets its own isolated browser session; the endpoint binds to loopback by default and requires a bearer token before it will listen on any other interface.
  • Runs wherever .NET does - The server ships as part of the Motus.Cli global tool, so dotnet tool install --global Motus.Cli is all that is needed. The tool targets .NET 8 and rolls forward, so it also runs on a machine that has only the .NET 10 runtime installed.

v1.0.12

View on GitHub

A TRX viewer has been added: point the CLI at any .trx file and the visual runner opens with the assembly/class/method tree, per-test outcomes and durations, captured stdout/stderr, and one-click rerun back into the live runner. A defensive fix to the browser-wide tracing gate prevents a leaked Tracing.StartAsync from deadlocking every subsequent trace on the same browser.

Improvements

  • TRX viewer with motus trx show <file.trx> - A new trx show CLI subcommand boots the visual runner against a parsed .trx instead of a live discovery, with a configurable --port (default 5300). TrxParserService reads <TestDefinitions>/<UnitTest> to index each test by both id and name, joins them with <Results>/<UnitTestResult> entries, and produces a TrxParseResult (tests, per-test states, run summary). Definitions contribute className and codeBase; results contribute outcome, duration, error info, and categories. A new ViewerMode enum (Runner / Trace / Trx) is threaded through RunnerOptions and RunnerHost so the same Blazor app serves all three modes from one process. ITestSessionService.LoadFromTrxResults populates the session's discovered tests and states from the parse result. TestExecutionService now refuses to execute TRX-loaded tests (read-only) and reports a clear error rather than nulling out on missing reflection metadata. DiscoveredTest was made nullable-friendly (Type? TestClass, MethodInfo? TestMethod, optional CodeBase and Categories) so TRX rows that have no live reflection can still flow through the same model.
  • TRX summary panel, sidebar tree, and viewer-aware layout - A new TrxSummaryPanel renders the run-level outcome counts and duration as the default landing view when no test is selected; selecting a test in the tree switches to the existing TestConsolePanel so per-test results, output, and stack traces stay in the same place across modes. MainLayout, RunnerToolbar, TimelinePanel, TestMethodNode, and TestSuiteNode were updated to hide irrelevant tabs and controls in ViewerMode.Trx (Browser View, Visual Regression, and the bottom timeline panel disappear; the toolbar shows TRX-specific stats). Tree nodes in TRX mode are non-runnable by default and clicking them selects the result for inspection.
  • One-click rerun back into the live runner with "Back to Results" - TrxRerunService resolves a TRX-discovered test against its original codeBase: it asks TestDiscovery to load the assembly and find the matching MethodInfo, then replaces the TRX-loaded DiscoveredTest with the reflected one (preserving the original CodeBase so the test stays rerunnable) and flips ViewerMode to Runner so the user lands in the live runner with the test executing. Failure paths are surfaced as test states rather than thrown exceptions: a missing or unbuilt assembly produces a Failed state with "Assembly not found at <path>. Build the project and try again."; an assembly load exception reports the message and stack trace; a renamed/removed method produces "Test method <name> not found in assembly. It may have been renamed or removed." A new toolbar "Back to Results" button calls BackToResults() to flip ViewerMode back to Trx and restore the TRX view without re-parsing. Unit tests cover the missing-assembly, missing-method, successful-rerun, and back-to-results paths.
  • Captured stdout and stderr surfaced per test - The TRX parser was reading only <Output>/<ErrorInfo> and discarding <StdOut> and <StdErr>. ExtractOutput (renamed from ExtractError) now pulls all four, and TestNodeState gained optional StdOut/StdErr fields (defaulted to null so the many existing positional constructions in TestExecutionService, TrxRerunService, and TestSessionService keep compiling untouched). TestConsolePanel renders new "Test Output" and "Test Error Output" sections styled to match the existing error/stack-trace blocks (scrollable, monospace, distinct background and accent for stderr); the "Test passed with no errors" success message is now suppressed when captured output is present, so a passing test with ITestOutputHelper/Console.WriteLine content shows the output rather than the cheerful fallback.

Bug Fixes

  • Leaked Tracing.StartAsync deadlocked every subsequent trace on the browser - The browser-wide ConditionalWeakTable<IMotusSession, SemaphoreSlim> that serializes CDP Tracing.start across parallel workers is acquired in StartAsync and released in StopAsync. If a test called StartAsync and exited before reaching StopAsync (early return, untracked exception path, fixture teardown blow-up), the semaphore stayed at count 0 for the lifetime of the browser session, and every subsequent Tracing.StartAsync on that browser hung forever waiting on the gate. Two defenses now apply: StartAsync waits on the gate with a 2-minute BrowserGateTimeout and throws a TimeoutException with an actionable message ("wrap test bodies that call StartAsync in try/finally to ensure StopAsync runs") instead of blocking indefinitely; and BrowserContext.CloseAsync invokes a new Tracing.ReleaseStateOnContextClose during disposal, which cancels the pump, completes the data channel, resets the started flag, and releases the gate as a best-effort idempotent cleanup. A regression test models the failure: a leaker calls StartAsync without StopAsync, disposal-time cleanup releases the gate, and a second Tracing on the same browser session must complete its StartAsync within two seconds.
  • Sidebar splitter wasn't draggable in TRX viewer mode - MainLayout.razor renders a sidebar-resize-handle element with grid-area: sidehandle and a pointer-event handler that resizes the sidebar column on drag. The TRX shell-style override declared its grid areas as 'toolbar toolbar toolbar' 'sidebar resize main', naming the middle column resize instead of sidehandle, so the handle's declared grid area did not match any declared area in TRX mode and the element wasn't placed where the user expected. The same handle worked in the Trace and Runner modes because the base CSS does declare a sidehandle area. Renamed the TRX middle column to sidehandle to match, restoring drag-to-resize behavior between the test tree and the main pane.
  • Parameterized TRX tests rendered every theory row as its own class node with a duplicated label - TestSuiteNode.razor groups discovered tests by t.TestClass?.FullName ?? GetClassFromFullName(t.FullName). For live-discovered tests, TestClass is a real Type and grouping uses the actual Namespace.ClassName. For TRX-loaded tests TestClass is null (no reflection), so the fallback walked back to the last dot in the test's display name. Parameterized test names like Bool_ValidValues ("False",False) contain no dot at all, so GetClassFromFullName returned the whole string and each theory row became a one-test "class" with the same label as its single method node — the tree showed the same name twice with one extra indent. DiscoveredTest gained a ClassFullName: string? field, the TRX parser now populates it from the className attribute it already reads from <TestMethod>, and the grouping key prefers it over the dot-split fallback. Theory rows now sit under their real class node and the duplicated parent label is gone.

v1.0.11

View on GitHub

Code coverage feature: per-test JavaScript and CSS coverage collected directly through CDP, source-map remapping back to original sources, console/HTML/Cobertura reporters, and CI-gated thresholds. Test-level retry on transient CDP disconnects and a transport-level hang fix round out the release.

Improvements

  • Code coverage collection over CDP - JavaScript coverage is collected per-page through Profiler.startPreciseCoverage (call-count plus detailed function ranges) and CSS rule-usage coverage through CSS.startRuleUsageTracking, both gated behind a new MotusCapabilities.CodeCoverage flag so BiDi sessions short-circuit cleanly with a diagnostic message instead of failing. The built-in CoverageCollector plugin enables the domains on page creation, takes a snapshot on page close, fetches script source through Debugger.getScriptSource, and pushes a CoverageData record into the per-test CoverageSink. Disabled by default; enabled via LaunchOptions.Coverage, the MOTUS_COVERAGE_ENABLE env var, the coverage.enable config key, or the CLI --coverage flag.
  • Per-test and per-run coverage aggregation - CoverageAggregator.SummarizeScript derives line-level stats from raw V8 byte ranges by mapping offsets to lines through the script source. MergeScripts, MergeStylesheets, and MergeOriginalFiles combine snapshots from many tests into a single aggregated CoverageData for the run, taking the max-coverage range for any overlapping ranges so a file covered by one test plus the same file covered by another test reports the union, not double-counted hits.
  • Source-map remapping back to original sources - When a coverage snapshot points at a bundled or minified script with a reachable source map (inline data URL or //# sourceMappingURL= reference), SourceMapResolver fetches the map (data URL inlined or HTTP-fetched with a per-process cache), SourceMapParser decodes the mappings via the new Vlq decoder, and CoverageRemapper walks the script's hit ranges and rewrites them onto the original source files. Resulting OriginalFileCoverage entries surface in CoverageData.OriginalFiles and feed both the report renderers and threshold evaluation, so a coverage report against app.min.js shows hits against Login.tsx and Header.tsx instead.
  • Coverage reporters and the ICoverageReporter plugin interface - CoverageConsoleReporter prints a per-file summary table colour-coded by coverage percentage. CoverageHtmlReporter emits a static HTML site with an index page, file tree, and per-file source views with green/red line-by-line highlighting. CoberturaReporter writes an XML document with <coverage> line-rate / lines-covered / lines-valid attributes plus packaged <class> entries with line-level hit counts, suitable for ingestion by Codecov, Azure DevOps, GitLab, and Jenkins. All three flow through the new CoverageReporterFactory, which parses --coverage specs and supports repeating the flag for multiple formats in one run. Third-party reporters opt in by implementing ICoverageReporter alongside IReporter: OnCoverageCollectedAsync fires per test, OnCoverageRunEndAsync fires once with the aggregated data — the same opt-in pattern as IAccessibilityReporter and IPerformanceReporter.
  • Coverage thresholds with CI failure on miss - CoverageThresholds.Evaluate compares the run's aggregated stats against coverage.js.lines, coverage.js.functions, and coverage.css.rules from motus.config.json (or LaunchOptions.Coverage). When a threshold is set and the run's percentage falls below it, the CLI prints Coverage threshold failed: <metric> <actual>% < <threshold>% and returns a non-zero exit code via TestRunResult.CoverageThresholdsFailed, so CI fails the build.
  • Coverage panel in the visual runner - The Blazor visual runner gains a CoveragePanel alongside the existing timeline and console panels. The panel reads from the new ICoverageService/CoverageService, which TestExecutionService feeds with the same snapshots that flow into the per-test sink. Per-test coverage is browsable inline as tests complete; aggregated run-end coverage shows in a summary view.
  • --coverage CLI flag with multi-format output and friendly errors - motus run --coverage console --coverage html:./out --coverage cobertura:./coverage.xml enables coverage and emits all three formats from a single run. Bare --coverage defaults to console. The flag flips MOTUS_COVERAGE_ENABLE=true for the run so the CoverageCollector plugin engages without requiring config-file changes. Invalid specs now emit a clean one-line error to stderr instead of dumping a stack trace through the System.CommandLine pipeline: --coverage html (missing target) tells the user the format requires <dir> and gives an example; --coverage cobertura does the same for <path>; --coverage console:foo rejects the spurious target; --coverage xml lists the supported formats; --coverage html: (empty target after the colon) is rejected with the same guidance. CLI returns exit code 1 for any of these so CI fails fast.
  • --retries N for transient CDP disconnects - Re-runs a failing test up to N additional times when (and only when) the failure chain contains CdpDisconnectedException or MotusTargetClosedException. The check walks InnerException, so wrapped failures still qualify. Non-transient failures (assertion errors, timeouts, real test bugs) are never retried, so flake recovery doesn't mask regressions. Each retry runs the entire test fresh: fresh test instance, fresh TestInitialize, fresh browser context, fresh WebSocket. Per-test sink data from a discarded attempt is dropped before the next attempt begins, so coverage/a11y/perf totals don't double-count. A [RETRY] <test> (CDP disconnect, attempt N/total) line is written to stderr for every retry, formatted, indented, and coloured to match the [PASS]/[FAIL] lines so it reads as part of the test stream.
  • Tracing serialization across browser sessions - CDP Tracing.start is browser-wide: only one trace can be active per browser process at a time. When multiple BrowserContexts share a browser (e.g. parallel workers under a shared-browser fixture), simultaneous StartAsync calls used to collide and one would fail with a CDP error. Tracing now coordinates through a ConditionalWeakTable<IMotusSession, SemaphoreSlim> keyed on the browser session, so concurrent starts queue rather than collide. The gate is held until StopAsync (or until StartAsync itself errors out, at which point it rolls back state and releases). Stale tracingComplete continuations from a previous run are also drained and their pumps cancelled at the top of StartAsync, preventing one run's dataCollected events from poisoning the next.

Bug Fixes

  • Profiler.getScriptSource doesn't exist; coverage was always 0/0 lines - The original coverage teardown called Profiler.getScriptSource, which is not a CDP method — script-source retrieval lives on the Debugger domain. Every call threw, the catch block logged the error, source stayed empty, and CoverageAggregator.SummarizeScript reported TotalLines = 0 for every script, collapsing every percentage to 0.0% regardless of how much code actually ran. Fixed by enabling the Debugger domain alongside Profiler in OnPageCreatedAsync and switching the source fetch to Debugger.getScriptSource. A best-effort Debugger.disable runs after Profiler.stopPreciseCoverage for symmetry.
  • Post-disconnect 60-second-per-send hang in CdpTransport - SendRawAsync only checked _disposed, not whether the receive loop had already observed a disconnect. After the receive loop exited and faulted in-flight requests, new sends were still accepted, the bytes went out, and each one waited the full 60-second CommandTimeout for a response that could never arrive. With coverage enabled this turned post-disconnect cleanup paths (one Profiler.takePreciseCoverage plus one Debugger.getScriptSource per script plus stopPreciseCoverage plus Debugger.disable) into multi-minute hangs that required Ctrl-C to recover from, masquerading as the test runner having frozen. Fixed by adding a _disconnected volatile flag set inside the receive loop's disconnect paths (clean close, exception, and dispose) through a single MarkDisconnectedAndFault helper. SendRawAsync now checks _disposed || _disconnected at the top and throws CdpDisconnectedException immediately. A regression test asserts that a send issued after an observed disconnect throws within two seconds rather than the prior sixty.

v1.0.10

View on GitHub

Selector repair and maintenance tooling lands as the headline feature, alongside DOM-scoped locator chains and parent-navigation selectors that bring resolution semantics in line with Playwright.

Improvements

  • motus check-selectors CLI command - New command that parses Locator, GetByRole, GetByText, GetByTestId, GetByLabel, GetByPlaceholder, GetByAltText, and GetByTitle calls out of C# sources via Roslyn, launches a browser, and reports each selector as HEALTHY, BROKEN, AMBIGUOUS, or SKIPPED against a live page. Supports --base-url for simple validation, --manifest for per-selector URL routing, --ci for non-zero exit on breakage, and --json for machine-readable output.
  • Selector manifests from record and codegen - Both commands now emit a <TestName>.selectors.json sidecar containing each locator's selector string, locator method, source file and line, captured page URL, and a DomFingerprint (tag name, key attributes, visible text, ancestor path, SHA-256 hash) built from DOM.describeNode and DOM.getOuterHTML. The manifest is the input that lets check-selectors navigate to the right page per selector and run fingerprint-based repair suggestions.
  • Repair suggestion pipeline and --fix - For every broken selector with a fingerprint match on the live page, the repair pipeline runs the DOM element through each registered ISelectorStrategy (testid → role → text → CSS by default) and grades candidates as High, Medium, or Low confidence. motus check-selectors --fix rewrites High-confidence replacements back into source via a Roslyn SyntaxRewriter that preserves trivia and formatting, writing .bak backups by default (suppressible with --no-backup).
  • Interactive repair in the visual runner - motus check-selectors --interactive opens the Blazor visual runner with a new SelectorRepairPanel. For each broken selector the panel shows the captured page with the candidate element highlighted via CDP DOM.highlightNode, the ranked repair suggestions, and accept/edit/skip controls. Accepted choices are written back to source through the same Roslyn rewriter used by --fix.
  • DOM-scoped child locators - page.Locator(parent).Locator(child) now resolves the parent handle first and then runs querySelectorAll for the child selector under each parent via Runtime.callFunctionOn, flattening and deduplicating results in parent-list order. Parents found via non-CSS strategies (xpath=, role=, text=, data-testid=) chain correctly because the parent handle is already materialized before the descendant query runs. Replaces the prior CSS-concatenation model, which silently produced wrong results when a non-CSS parent was chained with a CSS child.
  • Parent-navigation chains - Locator(parent).Locator("..").Locator(grandchild) walks from each parent match up one parentElement hop (or "../.." for two, etc.) before the next descendant query. ElementNotFoundException diagnostics distinguish "no parent match" from "parent matched but descendant didn't" and hint at portal-rendered DOM when the parent matched.
  • ILocator.EvaluateWithElementAsync - New method matching Playwright's convention where el => el.foo receives the element as the first argument, distinct from the existing EvaluateAsync which binds the element as this for function() { ... } literals. Doc comments on both methods now spell out which idiom to use when.
  • Smarter Evaluate/WaitForFunction argument handling - Page.EvaluateAsync and Locator.EvaluateAsync now detect whether the supplied expression is a function literal, identifier arrow, or parenthesized arrow, and only wrap/invoke it when an argument is supplied. Non-function expressions with an argument now throw a clear error instead of producing a confusing CDP failure.

Bug Fixes

  • WaitForFunction cancellation handling - The polling loop inside WaitForFunction no longer leaks OperationCanceledException from Task.Delay. Cancellation now routes through the page's cancellation token so callers see the same exception type on timeout and on explicit cancel.
  • Selector manifest tests on Windows - Tests that hardcoded /tmp paths and bare directory separators now use Path.GetTempPath() and Path.GetFullPath so the assertions pass on both Windows and Unix test runners, including for .g.cs generated filenames.
  • Locator scoping tests no longer race under parallel sends - LocatorDomScopingTests previously used a FIFO fake WebSocket, which occasionally paired responses with the wrong in-flight request when the threadpool interleaved callFunctionOn sends with getProperties continuations. The tests now use a method-aware fake socket that synthesizes responses from the outbound envelope's method and objectId, making the suite reliable regardless of send ordering.

v1.0.9

View on GitHub

Stability and reliability improvements for test execution, focusing on resilience under parallel load and graceful recovery from browser crashes.

Improvements

  • Context concurrency throttle - BrowserFixture now limits concurrent browser contexts to four via a static semaphore, preventing Chrome from becoming unresponsive when too many renderer processes compete for resources during parallel test runs.
  • Fixture reuse support - BrowserFixture.InitializeAsync resets disposed state and the restart semaphore so the fixture can be reused across consecutive runs (e.g. clicking Run All a second time in the visual runner).
  • Transport send serialization - Both CdpTransport and BiDiTransport now serialize WebSocket sends through a SemaphoreSlim, since ClientWebSocket does not support concurrent sends.
  • Transport receive buffer isolation - The CDP and BiDi receive loops now copy incoming WebSocket messages before deserialization so the next ReceiveAsync cannot overwrite data still referenced by in-flight JsonElement values.

Bug Fixes

  • Test setup failures after browser crash - NewContextAsync and NewPageAsync calls in test setup could fail if Chrome was still restarting from a previous crash. Added retry loops (up to three attempts with backoff) in the MSTest and NUnit test bases to ride through the restart window.
  • Cleanup exceptions masking test failures - Test teardown in both MSTest and NUnit now wraps tracing stop and context close in a try/catch so a crashed browser does not throw during cleanup and mask the original test failure. Teardown routes through the new BrowserFixture.CloseContextAsync to properly release the context throttle slot even on failure.
  • Page creation resource leaks - BrowserContext.NewPageAsync could leak Chrome targets and CDP sessions when page initialization timed out or failed partway through. Extracted a CreatePageCoreAsync helper with a 10-second initialization timeout and a catch block that disposes the page, removes the session, and closes the target on any failure.
  • MotusTargetClosedException not caught during shutdown - Browser.CloseAsync, BrowserContext close/dispose, and JsHandle.DisposeAsync only caught CdpDisconnectedException. Broadened the catch filters to also handle MotusTargetClosedException, which Chrome can raise when a target is already gone.
  • ObjectDisposedException on disposed transport - Sending on a disposed CdpTransport or BiDiTransport threw a generic ObjectDisposedException. Now throws the domain-specific CdpDisconnectedException or BiDiDisconnectedException so callers that already catch those types handle the disposed case consistently.

v1.0.8

View on GitHub

Performance testing, browser health detection, and reliability improvements across the test execution pipeline.

New Features

  • Performance metrics collection - Built-in Core Web Vitals collection via CDP Performance domain and PerformanceObserver API. Collects LCP, FCP, TTFB, CLS, INP, JS heap size, DOM node count, and individual layout shift entries. Metrics are gathered automatically after each navigation when the performance hook is enabled.
  • Performance budget assertions - New page-level assertions ToMeetPerformanceBudgetAsync(), ToHaveLcpBelowAsync(), ToHaveFcpBelowAsync(), ToHaveTtfbBelowAsync(), ToHaveClsBelowAsync(), and ToHaveInpBelowAsync() with auto-retry semantics and .Not negation support.
  • [PerformanceBudget] attribute - Apply to test methods or classes to declare metric thresholds. Budgets resolve from method attribute, class attribute, motus.config.json, or MOTUS_PERFORMANCE_* environment variables. Test framework adapters (MSTest, NUnit, xUnit) resolve the attribute and propagate it to the page automatically.
  • Performance CLI support - motus run --perf-budget enables budget enforcement from the command line. All built-in reporters (Console, HTML, JUnit, TRX) surface collected metrics and budget pass/fail status.
  • Browser health detection - Background BrowserHeartbeat pings Chrome every 5 seconds with a 10-second timeout to detect frozen browsers. Process.Exited event provides instant crash detection. Both mechanisms are guarded against double-firing and trigger the Disconnected event for downstream recovery.
  • IBrowser.IsHealthy property - Default interface member that checks both connection state and process liveness. For launched browsers, returns false when the process has exited even if the WebSocket has not yet detected the disconnect.
  • BrowserFixture auto-restart - When Chrome crashes or becomes unresponsive, BrowserFixture automatically disposes the dead browser and launches a replacement with retry. A SemaphoreSlim gate coordinates restart so NewContextAsync callers block briefly rather than racing against a dead browser. Compatible with parallel test execution across all three frameworks.
  • BrowserPool proactive replenishment - The browser pool subscribes to each browser's Disconnected event. On crash, the dead browser is disposed, its capacity slot is released, and a replacement is launched if the pool has dropped below MinInstances.

Improvements

  • Performance reporter integration - Reporters implementing IPerformanceReporter receive metrics alongside budget evaluation results. The visual runner surfaces metrics in timeline marker tooltips and a dedicated Performance section in the step detail panel.
  • Test method name propagation - TestMethodNameContext (AsyncLocal) carries the test method name from the visual runner's TestExecutionService into test base classes, enabling [PerformanceBudget] attribute resolution when the framework's TestContext is not injected.

Bug Fixes

  • CI test suite slowdown - Performance assertion tests blocked for 60 seconds per test because RefreshPerformanceMetricsAsync sent CDP commands with CancellationToken.None and no mock response was queued. Fixed by forwarding the assertion retry helper's cancellation token through to the CDP send, and queueing proper Runtime.evaluate responses in all affected tests. Reduced Motus.Tests.dll runtime from 16 minutes back to 2 minutes.
  • BrowserHeartbeat double-dispose - CloseAsync followed by DisposeAsync on a browser threw ObjectDisposedException because the heartbeat's CancellationTokenSource was disposed twice. Fixed with an Interlocked.CompareExchange guard on the heartbeat's DisposeAsync.
  • Tracing race condition - PumpTracingCompleteAsync used a shared _completeTcs field, allowing a cancelled old pump's cancellation handler to poison the next run's TaskCompletionSource. Fixed by passing a local TCS as a parameter.
  • CancellationTokenSource leaks - WaitForRequestAsync and WaitForResponseAsync in NetworkManager created linked CTS instances that were never disposed. Fixed with ContinueWith disposal on the returned task.
  • ScreencastService circular dependency - OnPageClose called StopAsync() which awaited operations that depended on the page being open. Simplified to cancel the pump and unsubscribe the event handler directly.

v1.0.7

View on GitHub

Feature release with built-in accessibility auditing, comprehensive user documentation, improved code coverage, and CI reliability fixes.

New Features

  • Accessibility auditing - Built-in WCAG 2.1 audit engine with 9 rules: missing alt text, empty links, empty buttons, unlabeled form controls, missing document language, heading hierarchy, color contrast, duplicate IDs, and missing landmarks. Each rule reports a severity (error or warning) and a WCAG criterion reference.
  • Accessibility assertions - New page-level assertion ToPassAccessibilityAuditAsync() with configurable options to skip rules or include warnings. Locator-level assertions ToHaveAccessibleNameAsync() and ToHaveRoleAsync() for verifying individual elements.
  • Accessibility lifecycle hook - AccessibilityAuditHook runs audits automatically after navigation and optionally after actions. Register via motus.config.json or LaunchOptions.Accessibility. Supports warn mode (log violations) and enforce mode (fail on violations).
  • Accessibility CLI support - motus run --a11y warn|enforce enables auditing from the command line. Violations are surfaced through the reporter pipeline with rule ID, severity, element selector, and WCAG criterion.
  • Record command viewport options - motus record now accepts --width and --height options to set the browser viewport size during recording (default 1024x768). Matches the existing pattern in motus screenshot and motus pdf.

Documentation

  • Getting Started guide - New top-level docs/getting-started.md covering installation, first test examples (MSTest, NUnit, xUnit), running tests, headed mode, slow motion, core concepts (locators, actions, assertions, navigation), and basic configuration.
  • Architecture docs - Four documents covering project structure and data flow, CDP/BiDi transport and protocol, browser lifecycle management, and selectors and assertions.
  • Extensions docs - Three documents covering plugin development, all 7 extensibility interfaces with member tables, and best practices for NativeAOT compatibility and thread safety.
  • Guides - Six documents covering configuration, testing frameworks, network interception, accessibility testing, recording and code generation, and Roslyn analyzers.
  • Migration guides - Two documents for migrating from Playwright and Selenium with API mapping tables and conceptual differences.

Improvements

  • Code coverage exclusions - Added coverage.runsettings to exclude source-generated code (CDP protocol domains, JSON serialization contexts) and the Blazor visual runner from coverage measurement. Overall line coverage improved from ~54% to ~80% with accurate representation of hand-written code.
  • New unit tests - Added tests for BrowserFinder (Edge, Chromium, auto-detect, InstalledBinariesPath per channel), BrowserPool and BrowserLease (return callback, dispose idempotency, options defaults), and RecordCommand (viewport option parsing and defaults).
  • Fill action coalescing - Increased fill debounce threshold and improved coalescing of consecutive fill actions on the same selector during recording, reducing redundant lines in generated test code.

Bug Fixes

  • CI integration test hang - Fixed CaptureFullWorkflowTrace sample test failing with "Tracing has already been started" when failure-tracing was active. The test now stops any pre-existing tracing before starting its own session, preventing the process from hanging on disposal.
  • CI workflow timeouts - Added timeout-minutes to the Chrome integration test step (10 min) and Motus report generation step (5 min) to prevent hung browser processes from blocking the pipeline indefinitely.
  • CI .NET SDK version - Added .NET 8.0 SDK to the integration job so Motus.Samples (which targets net8.0) builds and runs correctly alongside net10.0 projects.

v1.0.6

View on GitHub

Feature release with major codegen improvements, trace viewer enhancements, cookie banner removal for screenshot/PDF commands, and colored console output.

New Features

  • Codegen --headed mode - Launch a visible browser with motus codegen --headed, navigate to any page yourself, then press Enter to analyze. Supports providing URLs upfront (navigates then waits for Enter) or no URLs (opens a blank tab for free navigation).
  • Codegen --connect mode - Attach to an already-running browser with motus codegen --connect ws://localhost:9222 to analyze the active tab without launching a new browser instance. Works with or without URLs.
  • Codegen --scope option - Limit element discovery to a specific container with a CSS selector (e.g. --scope "#login-form", --scope ".modal-dialog"). Only elements inside the scoped container are analyzed and emitted.
  • Cookie banner removal - motus screenshot and motus pdf now support --hide-banners to remove cookie consent, privacy, and overlay banners before capture. Targets well-known selectors (OneTrust, CookieBot, Usercentrics, generic patterns) and clears body scroll locks.
  • Screenshot and PDF options - Both commands gained --timeout, --wait-until, and --delay options for better control over navigation and rendering. motus pdf also gained --width for viewport control.
  • Colored console reporter - Test results now display with ANSI color codes (green for pass, red for fail, gray for duration). Colors are automatically disabled when output is redirected.

Improvements

  • Codegen selector generation - Significantly improved selector hit rate through three changes:
  • Element handles are now stored at crawl time (window.__mtusElements), preventing stale references when the DOM mutates between discovery and resolution
  • Per-strategy error handling prevents one slow or failing strategy from blocking all remaining elements
  • Attribute-based CSS fallback generates selectors from name, placeholder, href, type, and aria-label when all strategies fail, verified for uniqueness before emitting
  • Implicit ARIA role inference - The role selector strategy now infers implicit roles from HTML semantics (<button> as button, <a href> as link, <input type="checkbox"> as checkbox, <select> as listbox, text inputs as textbox). This produces more stable selectors like role=button[name="Submit"] instead of falling through to text or CSS.
  • Trace viewer - Rewrote the trace viewer service to extract real timestamps, durations, and human-readable action labels from CDP trace events. Screenshots are aligned to timeline events via binary search. HAR network requests are loaded and matched to events by time window. The viewer now filters to significant events only.
  • Trace viewer layout - The sidebar and test explorer are hidden in trace mode since there are no tests to discover. The toolbar shows the trace filename and event count instead of run controls.
  • Browser launch timing - The visual runner now opens the browser after the server is fully listening (ApplicationStarted callback) instead of before, eliminating the need for a manual refresh on startup.

Bug Fixes

  • Null-check in MotusTestBase cleanup - TestContext.CurrentTestOutcome could throw a NullReferenceException during test cleanup if the TestContext was not initialized. Added a null-conditional check.

v1.0.5

View on GitHub

Patch release fixing the visual runner when installed as a global tool, plus CLI and logging improvements.

Bug Fixes

  • Fixed static assets 404 in global tool install - The visual runner (motus run --visual, motus trace show) returned 404 for _framework/blazor.web.js and other static resources when Motus.Cli was installed as a dotnet global tool. The tool package now bundles wwwroot content (app.css, screencast.js, scoped CSS) alongside the static web assets manifest. At startup, the runner detects whether the manifest's build-time paths are valid; if not (global tool install from CI), it falls back to Production mode and serves the bundled wwwroot via a PhysicalFileProvider while letting the ASP.NET Core framework handle _framework/ files through its standard pipeline.

Improvements

  • Suppressed ASP.NET Core log noise - The visual runner no longer prints info/warn log messages from Kestrel and the request pipeline. Only errors are shown by default. A verbose parameter is available on RunnerHost.StartAsync for diagnostics.
  • Added shutdown hint - The visual runner now prints Press Ctrl+C to stop. after the startup URL.
  • Fixed CLI command references in README - Changed dotnet motus ... to motus ... throughout the README since it is installed as a global tool.

v1.0.1

View on GitHub

Initial release of Motus, an extensible browser automation and testing framework for .NET. Motus communicates directly with browsers over WebSocket using source-generated protocol bindings, with no Node.js dependency.

Browser Automation Engine

  • Direct WebSocket communication with Chromium over CDP and Firefox over WebDriver BiDi
  • Source-generated protocol bindings via Roslyn incremental generator for NativeAOT compatibility
  • Full Page API: navigation, locators (GetByRole, GetByText, GetByLabel, GetByTestId, etc.), JavaScript evaluation, screenshots, PDF generation, and file downloads
  • Network interception and routing with request/response inspection
  • Browser contexts with isolated cookies, cache, storage, geolocation, and permissions
  • Keyboard, mouse, and touchscreen input simulation
  • Tracing, HAR export, and video recording

Plugin System

  • All built-in features (selector strategies, wait conditions, lifecycle hooks, reporters) are registered through the same IPluginContext available to third-party authors
  • [MotusPlugin] attribute with source-generated discovery via module initializer
  • Plugin interfaces: ISelectorStrategy, IWaitCondition, ILifecycleHook, IReporter

Roslyn Analyzers

  • Seven compile-time diagnostics (MOT001-MOT007) catching common automation mistakes: non-awaited async calls, hardcoded delays, fragile selectors, missing disposal, unused locators, deprecated selectors, and navigation without wait
  • Automated code fixes for MOT001 (add await), MOT002 (replace delay with wait), and MOT004 (wrap in await using)

Test Framework Integrations

  • Motus.Testing.MSTest with shared browser across the assembly, per-test context isolation, and [Parallelize] support
  • Motus.Testing.xUnit with collection and class fixtures for parallel execution
  • Motus.Testing.NUnit with per-fixture browser and [Parallelizable(ParallelScope.All)] support
  • Automatic failure tracing captures a trace ZIP on test failure (MSTest and NUnit; manual in xUnit)
  • Browser pool (IBrowserPool) for concurrent test execution with configurable worker count

Test Recorder

  • Record browser interactions in a headed session and emit compilable C# test code
  • Selector inference ranks test IDs and accessible roles over fragile CSS paths
  • Page Object Model generation via PomEmitter with automatic form field grouping
  • Supports MSTest, xUnit, and NUnit output frameworks

CLI Tool (dotnet motus)

  • motus run discovers and runs tests with parallel workers, filtering, and multiple reporters (console, JUnit XML, HTML, TRX)
  • motus record launches a headed browser and emits test code from recorded interactions
  • motus install downloads browser binaries (Chromium, Chrome, Edge, Firefox) with optional revision pinning
  • motus trace show opens recorded traces in the visual runner
  • motus screenshot and motus pdf for quick page capture
  • Interactive visual runner with timeline, step debugging, and visual regression UI

Packages

Package Description
Motus Core automation engine
Motus.Abstractions Plugin interfaces and browser API types
Motus.Codegen Roslyn source generator for CDP bindings and plugin discovery
Motus.Analyzers Compile-time diagnostics and code fixes
Motus.Recorder Interaction recorder and code emitter
Motus.Testing Shared browser fixture (framework-agnostic)
Motus.Testing.MSTest MSTest integration
Motus.Testing.xUnit xUnit integration
Motus.Testing.NUnit NUnit integration
Motus.Cli Command-line tool (installed via dotnet tool install -g Motus.Cli)