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 GitHubThis 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-piperather 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 -
HandleSIGINTandHandleSIGTERMwere wired toProcessExitandCancelKeyPress, neither of which fires for a signal on Unix, so the browser they promised to close was left running by every Ctrl+C and everykill. They are now real signal registrations, andHandleSIGTERMcovers 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 ofpage.Framesat 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.ChildFramesandframe_listpromised 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 -
ConnectAsyncbounds 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 -
KeyboardTypeOptionsandKeyboardPressOptionsgain aTimeout,ILocator.SelectOptionAsyncgains an overload taking one, andFilterhonors 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 letsmotus mcp --timeoutreachtype,press, andselect_option. - Popups are tracked wherever they open - A tab opened by
window.openor atarget="_blank"link is a page of the context that opened it, for a browser Motus started as well as one it attached to.context.Pageslists it,IPage.Popupfires 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_accessibilityfollows the same rule: a violation on a node the snapshot gave no ref, such as an image with no alt text, reportsrefas null and identifies the node bynodeRole,nodeName, the newnodeText, andselector. - Frames are part of the page - An
iframewhose 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, sof1e2is the second addressable element of frame 1, and passing it toclickortypeacts inside the frame with nothing selected first. Ten frames are read by default andmax_framesonsnapshotchanges that; past the limit, and for a frame that is hidden or unreadable, the snapshot says how many were left out and points atframe_listandframe_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 asnapshot, aconsole_messagesand atab_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 indextab_selecttakes, 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--settlesets that wait.click,type,press,select_option,set_checked,navigate,reload,go_backandgo_forwardalso takesnapshot: true, which appends a fresh snapshot to the result, andnavigatenames 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
refnow takes a selector in its place: CSS by default, or prefixed withxpath=,text=,role=, ordata-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. clickcan use the other mouse buttons - It takesbutton(left,right,middle) andmodifiers(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 withA 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 returnsThe 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 acceptor--dialogs dismissanswers them without the round trip. - One request in full -
network_requesttakes the sequence numbernetwork_requestsprints 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_listcovers 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_selectandtab_closetake 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_openstill follows the active context, socontext_selectdecides 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 thanValue 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 ofA 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, withMOTUS_MCP_CAPSin the environment ormcp.capsinmotus.config.jsonas 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 mcpnow carries the launch and context settings an agent session needs to match the machine it runs on:--browser-arg(repeatable, and--browser-arg=--no-sandboxis what a container running as root needs before Chromium will start at all),--executable-path,--user-data-dir,--storage-state,--proxy-serverand--proxy-bypass,--user-agent,--locale,--timezone,--timeoutand--navigation-timeout,--settle,--dialogs, and--configto take defaults from amotus.config.jsonthat already exists rather than restating them on the command line.--channelis honored for the first time: it was read only to look up a browsermotus installhad downloaded, and the options the browser was actually started with never carried it, so--channel firefoxon 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-pathas 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, andbrowser_attachis advertised only when the operator allowed it. Each is a behavior change and is spelled out below.--allow-unrestricted-file-accessrestores the old file behavior for anyone who was relying on it.
Fixes
- A context route reaches a tab that was already open -
context.RouteAsynccopied 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.StopAsyncwrote a ZIP holding an emptytrace.json, every time, headless or headed, andmotus trace showreported "No actions recorded". The browser returns a streamed trace as one JSON object holding atraceEventsarray, 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 threwEither 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.GetByRolewas never affected, which is why the samples did not catch it; the MCProle=selector prefix was.- The alt-text rule fires on Chromium -
a11y-alt-textmatched the roleimg, and Chromium reportsimage, 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,articlestructure 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, andwait_for_element, the attach case in crash recovery, the HTTP transport's idle timeout, and the full option table including--capsand--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
CdpPipeSocketbeside 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
.gitattributesrule, 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 mcpand usedclick_xy,drag,resize, thecontext_*tools, theroute_*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_attachneeds 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--connectare unaffected. - MCP: artifacts are written inside an output directory -
trace_stop,har_stopandvideo_starttook any path the agent handed them and wrote there, andupload_filesread any file on the machine. Paths are now resolved inside one output directory, a directory for this run under the temporary directory unless--output-dirnames 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--httpevery session shares the one directory.--allow-unrestricted-file-accessrestores the old behavior. - MCP:
file://URLs are refused -navigate,tab_openand 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 afile:URL was reading the machine's files throughsnapshotandevaluate. Anything with no scheme is still treated the way a typed address would be.--allow-unrestricted-file-accessenables it again. - MCP: the console and network logs no longer empty themselves when they are read -
console_messagesandnetwork_requestscleared 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 takesince, a sequence number to read from, and both end with anext=Nline to pass back as the nextsince; a read that misses entries the buffer has already dropped says how many. A client that reads withoutsincenow 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_listused 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 acontext_selectwill 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.
AccessibilitySnapshotAsyncnests 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 besidemainrather than inside it, andbannerandmaincame 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, andRootsis normally the document alone. Code that walkedRootsexpecting orphaned subtrees at the top level will find them in place instead. Both readers of the tree change with it: the MCPsnapshottool, 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, socontext.Pages, the context'sPageevent,IPage.Popupand 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.StopAsyncfails rather than writing an empty trace - A trace payload that cannot be read now throwsMotusProtocolExceptionnaming 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-textreports images on Chromium - The rule never fired there, so a suite assertingToPassAccessibilityAuditAsyncagainst a page with an unnamed image passed. It will fail now, and the audit hook inwarnmode will print violations it never printed. Addalttext, or skip the rule withSkipRules("a11y-alt-text")while that is done.- A page-level
role=selector returns matches instead of throwing - Code that caughtMotusProtocolExceptionaroundpage.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 calledDisconnectAsyncon 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 GitHubMotus 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.ConnectAsynctakes either the CDP WebSocket URL or the HTTP debugging endpoint (http://127.0.0.1:9222) and adopts what is already open, sobrowser.Contextsandcontext.Pagesare 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.ConnectOptionscarriesAdoptExistingTargets,SlowMo, and aTimeoutthat 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.OwnsProcessreports whether Motus started the browser, andDisconnectAsyncends 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.Framesand in its parent'sChildFrames, 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 ordinaryIFrame. - Execution worlds -
IFrame.EvaluateAsyncgains an overload takingEvaluateOptions { 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 -
IPagegainsFrameAttached,FrameNavigated, andFrameDetached, andIFramegainsIsDetached, 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 newbrowser_attachtool 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_statusreports 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_listandframe_selectscope the session to one frame, the same waytab_selectandcontext_selectwork, so a frame is addressable state rather than an argument repeated on every call. Scope coverssnapshot,evaluate, and thewait_fortext 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-lookingiframeis pointed atframe_listrather 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--outputfor 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 throughTestSuiteInfo. - Flaky tests and quarantine -
--retriesand--retry-policydistinguish a retry for a transient fault from a retry that is hunting flakiness:transient, the default, re-runs only CDP disconnects, whileflakere-runs any failure and marks a test that then passes as flaky rather than green.--fail-on-flakydecides 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 installaccepts an exact Chromium revision, andlaunch.executablePathinmotus.config.jsonorMOTUS_EXECUTABLE_PATHin 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.ShowCursordraws 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.NaturalMouseMotionmoves in eased multi-step paths rather than teleporting, which both looks right in a recording and satisfies pages that require observed movement.--show-cursorand--natural-mouseexpose both to the MCP server, and--show-cursorturns 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 fourMotus.Testingpackages 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 mergeandcheck-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
connectOverCDPandframeLocatorby name. Configuration documents theflaky,shardandcoveragesections,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 newevaluateresult shape along with the cursor, viewport and recovery options.
Behavior changes
CloseAsyncno longer ends a browser Motus did not start - This was a defect: closing an attached browser sentBrowser.closeand terminated a process belonging to somebody else. It now closes the contexts Motus created and disconnects. If you were relying onCloseAsyncto end a browser you connected to, end the process yourself;DisposeAsyncwill not do it either, and never did.- A locator from
IFramenow resolves inside that frame -frame.Locator(...)and theGetBy*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. Usepage.Locator(...)where the main frame was what you actually wanted. ILocator.BoundingBoxAsyncanswers in page coordinates for a frame-rooted locator - It previously measured in the frame's own coordinate space, so a box handed topage.Mousemissed by the frame's offset. Code that was correcting for that offset by hand should stop.IPage.ScreenshotAsynchonorsScreenshotOptions.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 fromBrowserFailure.IsBrowserLost, which is exactly what[MotusTestClass]and--retry-policy transientask 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 catchingMotusAssertionExceptionaround an assertion will seeMotusTargetClosedExceptionin this case. - MCP:
evaluatereturns its value under aresultkey - 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 readresult; 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 GitHubMotus'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);dragpresses, 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,snapshotnow says so explicitly and points to the coordinate tools, where perception shifts from the element tree to screenshots. - Page video recording -
video_startandvideo_stoprecord 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 WIDTHxHEIGHToption sets the page size for the whole session (default 1280x800), headed windows are sized to match, and theresizetool changes the viewport mid-session when controls sit at or beyond its edge. - Engine API: video and modifier keys - The library gains
IPage.StartVideoRecordingAsync/StopVideoRecordingAsyncfor 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_filesremain 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 motusand 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 GitHubMotus 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. OnceMotus.Cliis 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.Cliglobal tool, sodotnet tool install --global Motus.Cliis 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 GitHubA 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 newtrx showCLI subcommand boots the visual runner against a parsed.trxinstead of a live discovery, with a configurable--port(default5300).TrxParserServicereads<TestDefinitions>/<UnitTest>to index each test by bothidandname, joins them with<Results>/<UnitTestResult>entries, and produces aTrxParseResult(tests, per-test states, run summary). Definitions contributeclassNameandcodeBase; results contribute outcome, duration, error info, and categories. A newViewerModeenum (Runner/Trace/Trx) is threaded throughRunnerOptionsandRunnerHostso the same Blazor app serves all three modes from one process.ITestSessionService.LoadFromTrxResultspopulates the session's discovered tests and states from the parse result.TestExecutionServicenow refuses to execute TRX-loaded tests (read-only) and reports a clear error rather than nulling out on missing reflection metadata.DiscoveredTestwas made nullable-friendly (Type? TestClass,MethodInfo? TestMethod, optionalCodeBaseandCategories) 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
TrxSummaryPanelrenders 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 existingTestConsolePanelso per-test results, output, and stack traces stay in the same place across modes.MainLayout,RunnerToolbar,TimelinePanel,TestMethodNode, andTestSuiteNodewere updated to hide irrelevant tabs and controls inViewerMode.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" -
TrxRerunServiceresolves a TRX-discovered test against its originalcodeBase: it asksTestDiscoveryto load the assembly and find the matchingMethodInfo, then replaces the TRX-loadedDiscoveredTestwith the reflected one (preserving the originalCodeBaseso the test stays rerunnable) and flipsViewerModetoRunnerso 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 aFailedstate 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 callsBackToResults()to flipViewerModeback toTrxand 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 fromExtractError) now pulls all four, andTestNodeStategained optionalStdOut/StdErrfields (defaulted tonullso the many existing positional constructions inTestExecutionService,TrxRerunService, andTestSessionServicekeep compiling untouched).TestConsolePanelrenders 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 withITestOutputHelper/Console.WriteLinecontent 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 CDPTracing.startacross parallel workers is acquired inStartAsyncand released inStopAsync. If a test calledStartAsyncand exited before reachingStopAsync(early return, untracked exception path, fixture teardown blow-up), the semaphore stayed at count0for the lifetime of the browser session, and every subsequentTracing.StartAsyncon that browser hung forever waiting on the gate. Two defenses now apply:StartAsyncwaits on the gate with a 2-minuteBrowserGateTimeoutand throws aTimeoutExceptionwith an actionable message ("wrap test bodies that call StartAsync in try/finally to ensure StopAsync runs") instead of blocking indefinitely; andBrowserContext.CloseAsyncinvokes a newTracing.ReleaseStateOnContextCloseduring 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 callsStartAsyncwithoutStopAsync, disposal-time cleanup releases the gate, and a secondTracingon the same browser session must complete itsStartAsyncwithin two seconds. - Sidebar splitter wasn't draggable in TRX viewer mode -
MainLayout.razorrenders asidebar-resize-handleelement withgrid-area: sidehandleand 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 columnresizeinstead ofsidehandle, 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 asidehandlearea. Renamed the TRX middle column tosidehandleto 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.razorgroups discovered tests byt.TestClass?.FullName ?? GetClassFromFullName(t.FullName). For live-discovered tests,TestClassis a realTypeand grouping uses the actualNamespace.ClassName. For TRX-loaded testsTestClassis null (no reflection), so the fallback walked back to the last dot in the test's display name. Parameterized test names likeBool_ValidValues ("False",False)contain no dot at all, soGetClassFromFullNamereturned 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.DiscoveredTestgained aClassFullName: string?field, the TRX parser now populates it from theclassNameattribute 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 GitHubCode 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 throughCSS.startRuleUsageTracking, both gated behind a newMotusCapabilities.CodeCoverageflag so BiDi sessions short-circuit cleanly with a diagnostic message instead of failing. The built-inCoverageCollectorplugin enables the domains on page creation, takes a snapshot on page close, fetches script source throughDebugger.getScriptSource, and pushes aCoverageDatarecord into the per-testCoverageSink. Disabled by default; enabled viaLaunchOptions.Coverage, theMOTUS_COVERAGE_ENABLEenv var, thecoverage.enableconfig key, or the CLI--coverageflag. - Per-test and per-run coverage aggregation -
CoverageAggregator.SummarizeScriptderives line-level stats from raw V8 byte ranges by mapping offsets to lines through the script source.MergeScripts,MergeStylesheets, andMergeOriginalFilescombine snapshots from many tests into a single aggregatedCoverageDatafor 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),SourceMapResolverfetches the map (data URL inlined or HTTP-fetched with a per-process cache),SourceMapParserdecodes the mappings via the newVlqdecoder, andCoverageRemapperwalks the script's hit ranges and rewrites them onto the original source files. ResultingOriginalFileCoverageentries surface inCoverageData.OriginalFilesand feed both the report renderers and threshold evaluation, so a coverage report againstapp.min.jsshows hits againstLogin.tsxandHeader.tsxinstead. - Coverage reporters and the
ICoverageReporterplugin interface -CoverageConsoleReporterprints a per-file summary table colour-coded by coverage percentage.CoverageHtmlReporteremits a static HTML site with an index page, file tree, and per-file source views with green/red line-by-line highlighting.CoberturaReporterwrites 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 newCoverageReporterFactory, which parses--coveragespecs and supports repeating the flag for multiple formats in one run. Third-party reporters opt in by implementingICoverageReporteralongsideIReporter:OnCoverageCollectedAsyncfires per test,OnCoverageRunEndAsyncfires once with the aggregated data — the same opt-in pattern asIAccessibilityReporterandIPerformanceReporter. - Coverage thresholds with CI failure on miss -
CoverageThresholds.Evaluatecompares the run's aggregated stats againstcoverage.js.lines,coverage.js.functions, andcoverage.css.rulesfrommotus.config.json(orLaunchOptions.Coverage). When a threshold is set and the run's percentage falls below it, the CLI printsCoverage threshold failed: <metric> <actual>% < <threshold>%and returns a non-zero exit code viaTestRunResult.CoverageThresholdsFailed, so CI fails the build. - Coverage panel in the visual runner - The Blazor visual runner gains a
CoveragePanelalongside the existing timeline and console panels. The panel reads from the newICoverageService/CoverageService, whichTestExecutionServicefeeds 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. --coverageCLI flag with multi-format output and friendly errors -motus run --coverage console --coverage html:./out --coverage cobertura:./coverage.xmlenables coverage and emits all three formats from a single run. Bare--coveragedefaults to console. The flag flipsMOTUS_COVERAGE_ENABLE=truefor the run so theCoverageCollectorplugin 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 coberturadoes the same for<path>;--coverage console:foorejects the spurious target;--coverage xmllists the supported formats;--coverage html:(empty target after the colon) is rejected with the same guidance. CLI returns exit code1for any of these so CI fails fast.--retries Nfor transient CDP disconnects - Re-runs a failing test up toNadditional times when (and only when) the failure chain containsCdpDisconnectedExceptionorMotusTargetClosedException. The check walksInnerException, 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, freshTestInitialize, 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.startis browser-wide: only one trace can be active per browser process at a time. When multipleBrowserContexts share a browser (e.g. parallel workers under a shared-browser fixture), simultaneousStartAsynccalls used to collide and one would fail with a CDP error.Tracingnow coordinates through aConditionalWeakTable<IMotusSession, SemaphoreSlim>keyed on the browser session, so concurrent starts queue rather than collide. The gate is held untilStopAsync(or untilStartAsyncitself errors out, at which point it rolls back state and releases). StaletracingCompletecontinuations from a previous run are also drained and their pumps cancelled at the top ofStartAsync, preventing one run'sdataCollectedevents from poisoning the next.
Bug Fixes
Profiler.getScriptSourcedoesn't exist; coverage was always 0/0 lines - The original coverage teardown calledProfiler.getScriptSource, which is not a CDP method — script-source retrieval lives on theDebuggerdomain. Every call threw, the catch block logged the error, source stayed empty, andCoverageAggregator.SummarizeScriptreportedTotalLines = 0for every script, collapsing every percentage to0.0%regardless of how much code actually ran. Fixed by enabling theDebuggerdomain alongsideProfilerinOnPageCreatedAsyncand switching the source fetch toDebugger.getScriptSource. A best-effortDebugger.disableruns afterProfiler.stopPreciseCoveragefor symmetry.- Post-disconnect 60-second-per-send hang in
CdpTransport-SendRawAsynconly 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-secondCommandTimeoutfor a response that could never arrive. With coverage enabled this turned post-disconnect cleanup paths (oneProfiler.takePreciseCoverageplus oneDebugger.getScriptSourceper script plusstopPreciseCoverageplusDebugger.disable) into multi-minute hangs that required Ctrl-C to recover from, masquerading as the test runner having frozen. Fixed by adding a_disconnectedvolatile flag set inside the receive loop's disconnect paths (clean close, exception, and dispose) through a singleMarkDisconnectedAndFaulthelper.SendRawAsyncnow checks_disposed || _disconnectedat the top and throwsCdpDisconnectedExceptionimmediately. 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 GitHubSelector 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-selectorsCLI command - New command that parsesLocator,GetByRole,GetByText,GetByTestId,GetByLabel,GetByPlaceholder,GetByAltText, andGetByTitlecalls out of C# sources via Roslyn, launches a browser, and reports each selector asHEALTHY,BROKEN,AMBIGUOUS, orSKIPPEDagainst a live page. Supports--base-urlfor simple validation,--manifestfor per-selector URL routing,--cifor non-zero exit on breakage, and--jsonfor machine-readable output.- Selector manifests from
recordandcodegen- Both commands now emit a<TestName>.selectors.jsonsidecar containing each locator's selector string, locator method, source file and line, captured page URL, and aDomFingerprint(tag name, key attributes, visible text, ancestor path, SHA-256 hash) built fromDOM.describeNodeandDOM.getOuterHTML. The manifest is the input that letscheck-selectorsnavigate 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 registeredISelectorStrategy(testid → role → text → CSS by default) and grades candidates asHigh,Medium, orLowconfidence.motus check-selectors --fixrewrites High-confidence replacements back into source via a RoslynSyntaxRewriterthat preserves trivia and formatting, writing.bakbackups by default (suppressible with--no-backup). - Interactive repair in the visual runner -
motus check-selectors --interactiveopens the Blazor visual runner with a newSelectorRepairPanel. For each broken selector the panel shows the captured page with the candidate element highlighted via CDPDOM.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 runsquerySelectorAllfor the child selector under each parent viaRuntime.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 oneparentElementhop (or"../.."for two, etc.) before the next descendant query.ElementNotFoundExceptiondiagnostics 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 whereel => el.fooreceives the element as the first argument, distinct from the existingEvaluateAsyncwhich binds the element asthisforfunction() { ... }literals. Doc comments on both methods now spell out which idiom to use when.- Smarter
Evaluate/WaitForFunctionargument handling -Page.EvaluateAsyncandLocator.EvaluateAsyncnow 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
WaitForFunctioncancellation handling - The polling loop insideWaitForFunctionno longer leaksOperationCanceledExceptionfromTask.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
/tmppaths and bare directory separators now usePath.GetTempPath()andPath.GetFullPathso the assertions pass on both Windows and Unix test runners, including for.g.csgenerated filenames. - Locator scoping tests no longer race under parallel sends -
LocatorDomScopingTestspreviously used a FIFO fake WebSocket, which occasionally paired responses with the wrong in-flight request when the threadpool interleavedcallFunctionOnsends withgetPropertiescontinuations. The tests now use a method-aware fake socket that synthesizes responses from the outbound envelope's method andobjectId, making the suite reliable regardless of send ordering.
v1.0.9
View on GitHubStability and reliability improvements for test execution, focusing on resilience under parallel load and graceful recovery from browser crashes.
Improvements
- Context concurrency throttle -
BrowserFixturenow 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.InitializeAsyncresets 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
CdpTransportandBiDiTransportnow serialize WebSocket sends through aSemaphoreSlim, sinceClientWebSocketdoes not support concurrent sends. - Transport receive buffer isolation - The CDP and BiDi receive loops now copy incoming WebSocket messages before deserialization so the next
ReceiveAsynccannot overwrite data still referenced by in-flightJsonElementvalues.
Bug Fixes
- Test setup failures after browser crash -
NewContextAsyncandNewPageAsynccalls 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.CloseContextAsyncto properly release the context throttle slot even on failure. - Page creation resource leaks -
BrowserContext.NewPageAsynccould leak Chrome targets and CDP sessions when page initialization timed out or failed partway through. Extracted aCreatePageCoreAsynchelper 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,BrowserContextclose/dispose, andJsHandle.DisposeAsynconly caughtCdpDisconnectedException. Broadened the catch filters to also handleMotusTargetClosedException, which Chrome can raise when a target is already gone. - ObjectDisposedException on disposed transport - Sending on a disposed
CdpTransportorBiDiTransportthrew a genericObjectDisposedException. Now throws the domain-specificCdpDisconnectedExceptionorBiDiDisconnectedExceptionso callers that already catch those types handle the disposed case consistently.
v1.0.8
View on GitHubPerformance 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
Performancedomain andPerformanceObserverAPI. 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(), andToHaveInpBelowAsync()with auto-retry semantics and.Notnegation support. [PerformanceBudget]attribute - Apply to test methods or classes to declare metric thresholds. Budgets resolve from method attribute, class attribute,motus.config.json, orMOTUS_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-budgetenables 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
BrowserHeartbeatpings Chrome every 5 seconds with a 10-second timeout to detect frozen browsers.Process.Exitedevent provides instant crash detection. Both mechanisms are guarded against double-firing and trigger theDisconnectedevent for downstream recovery. IBrowser.IsHealthyproperty - Default interface member that checks both connection state and process liveness. For launched browsers, returnsfalsewhen the process has exited even if the WebSocket has not yet detected the disconnect.- BrowserFixture auto-restart - When Chrome crashes or becomes unresponsive,
BrowserFixtureautomatically disposes the dead browser and launches a replacement with retry. ASemaphoreSlimgate coordinates restart soNewContextAsynccallers 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
Disconnectedevent. On crash, the dead browser is disposed, its capacity slot is released, and a replacement is launched if the pool has dropped belowMinInstances.
Improvements
- Performance reporter integration - Reporters implementing
IPerformanceReporterreceive 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'sTestExecutionServiceinto test base classes, enabling[PerformanceBudget]attribute resolution when the framework'sTestContextis not injected.
Bug Fixes
- CI test suite slowdown - Performance assertion tests blocked for 60 seconds per test because
RefreshPerformanceMetricsAsyncsent CDP commands withCancellationToken.Noneand no mock response was queued. Fixed by forwarding the assertion retry helper's cancellation token through to the CDP send, and queueing properRuntime.evaluateresponses in all affected tests. ReducedMotus.Tests.dllruntime from 16 minutes back to 2 minutes. - BrowserHeartbeat double-dispose -
CloseAsyncfollowed byDisposeAsyncon a browser threwObjectDisposedExceptionbecause the heartbeat'sCancellationTokenSourcewas disposed twice. Fixed with anInterlocked.CompareExchangeguard on the heartbeat'sDisposeAsync. - Tracing race condition -
PumpTracingCompleteAsyncused a shared_completeTcsfield, allowing a cancelled old pump's cancellation handler to poison the next run'sTaskCompletionSource. Fixed by passing a local TCS as a parameter. - CancellationTokenSource leaks -
WaitForRequestAsyncandWaitForResponseAsyncinNetworkManagercreated linked CTS instances that were never disposed. Fixed withContinueWithdisposal on the returned task. - ScreencastService circular dependency -
OnPageClosecalledStopAsync()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 GitHubFeature 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 (
errororwarning) and a WCAG criterion reference. - Accessibility assertions - New page-level assertion
ToPassAccessibilityAuditAsync()with configurable options to skip rules or include warnings. Locator-level assertionsToHaveAccessibleNameAsync()andToHaveRoleAsync()for verifying individual elements. - Accessibility lifecycle hook -
AccessibilityAuditHookruns audits automatically after navigation and optionally after actions. Register viamotus.config.jsonorLaunchOptions.Accessibility. Supportswarnmode (log violations) andenforcemode (fail on violations). - Accessibility CLI support -
motus run --a11y warn|enforceenables 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 recordnow accepts--widthand--heightoptions to set the browser viewport size during recording (default 1024x768). Matches the existing pattern inmotus screenshotandmotus pdf.
Documentation
- Getting Started guide - New top-level
docs/getting-started.mdcovering 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.runsettingsto 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),BrowserPoolandBrowserLease(return callback, dispose idempotency, options defaults), andRecordCommand(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
CaptureFullWorkflowTracesample 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-minutesto 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 targetsnet8.0) builds and runs correctly alongsidenet10.0projects.
v1.0.6
View on GitHubFeature release with major codegen improvements, trace viewer enhancements, cookie banner removal for screenshot/PDF commands, and colored console output.
New Features
- Codegen
--headedmode - Launch a visible browser withmotus 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
--connectmode - Attach to an already-running browser withmotus codegen --connect ws://localhost:9222to analyze the active tab without launching a new browser instance. Works with or without URLs. - Codegen
--scopeoption - 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 screenshotandmotus pdfnow support--hide-bannersto 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--delayoptions for better control over navigation and rendering.motus pdfalso gained--widthfor 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, andaria-labelwhen all strategies fail, verified for uniqueness before emitting - Implicit ARIA role inference - The role selector strategy now infers implicit roles from HTML semantics (
<button>asbutton,<a href>aslink,<input type="checkbox">ascheckbox,<select>aslistbox, text inputs astextbox). This produces more stable selectors likerole=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 (
ApplicationStartedcallback) instead of before, eliminating the need for a manual refresh on startup.
Bug Fixes
- Null-check in MotusTestBase cleanup -
TestContext.CurrentTestOutcomecould throw aNullReferenceExceptionduring test cleanup if theTestContextwas not initialized. Added a null-conditional check.
v1.0.5
View on GitHubPatch 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.jsand 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 aPhysicalFileProviderwhile 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
verboseparameter is available onRunnerHost.StartAsyncfor 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 ...tomotus ...throughout the README since it is installed as a global tool.
v1.0.1
View on GitHubInitial 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
IPluginContextavailable 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 inawait using)
Test Framework Integrations
Motus.Testing.MSTestwith shared browser across the assembly, per-test context isolation, and[Parallelize]supportMotus.Testing.xUnitwith collection and class fixtures for parallel executionMotus.Testing.NUnitwith 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
PomEmitterwith automatic form field grouping - Supports MSTest, xUnit, and NUnit output frameworks
CLI Tool (dotnet motus)
motus rundiscovers and runs tests with parallel workers, filtering, and multiple reporters (console, JUnit XML, HTML, TRX)motus recordlaunches a headed browser and emits test code from recorded interactionsmotus installdownloads browser binaries (Chromium, Chrome, Edge, Firefox) with optional revision pinningmotus trace showopens recorded traces in the visual runnermotus screenshotandmotus pdffor 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) |