# appium/appium-wincore-driver architecture

> Architecture diagram of the GitHub repository appium/appium-wincore-driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/appium/appium-wincore-driver
- Repository: https://github.com/appium/appium-wincore-driver

## Overview

Appium WinCore Driver automates Windows desktop applications through an Appium-facing TypeScript driver and a native C# JSON-RPC server. The core workflow is session setup, locator conversion/search, and element or window operations against the live UI Automation tree; results return through the server client. The README also documents hybrid WebView/CDP, Internet Explorer, accessibility, clipboard, and screen-recording capabilities. Some native command implementations and integrations are unsampled, so their documented presence is shown without guessing internal call paths.

Main entry points: [`csharp/WincoreServer/Server/CommandDispatcher.cs`](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/CommandDispatcher.cs) (Command Dispatcher), [`lib/driver.ts`](https://github.com/appium/appium-wincore-driver/blob/main/lib/driver.ts) (Appium Driver), [`csharp/WincoreServer/Uia3/UIA.cs`](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Uia3/UIA.cs) (UI Automation), [`csharp/WincoreServer/Commands/SessionCommands.cs`](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/SessionCommands.cs) (Session Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_appium["Appium Driver"]
  node_driver["Appium Driver<br/>[driver.ts]"]
  node_commands["Driver Commands"]
  node_selectors["Selector Processing<br/>[parser.ts]"]
  node_css["CSS Conversion<br/>[index.ts]"]
  node_serverclient["Server Client<br/>[client.ts]"]
end

subgraph group_native["Native Automation Server"]
  node_nativeentry["Server Entry<br/>[Program.cs]"]
  node_rpc["JSON-RPC Server<br/>[JsonRpcServer.cs]"]
  node_dispatcher["Command Dispatcher"]
  node_session["Session State<br/>[SessionState.cs]"]
  node_sessioncmd["Session Setup<br/>[SessionCommands.cs]"]
  node_find["Element Search<br/>[FindCommands.cs]"]
  node_xpath["XPath Search<br/>[XPathCommands.cs]"]
  node_pagesource["Page Source"]
  node_patterns["UIA Patterns<br/>[PatternCommands.cs]"]
  node_accessibility["Accessibility Values"]
  node_othercommands["Window And Device APIs"]
  node_uia["UI Automation<br/>[UIA.cs]"]
  node_conditions["Condition Builder"]
  node_sdk["Provider SDK<br/>[ITreeProvider.cs]"]
  node_plugins["Plugin Hosting<br/>[PluginHost.cs]"]
end

subgraph group_integration["Browser Integrations"]
  node_ieclient["IE DOM Client<br/>[session.ts]"]
  node_iebridge["IE DOM Bridge<br/>[IEBridge.cs]"]
  node_cdp["WebView CDP<br/>[extension.ts]"]
end

subgraph group_platform["Windows Platform"]
  node_winapi["Windows Input API<br/>[user32.ts]"]
end

node_user(("Automation Client"))
node_desktop(("Windows Application"))
node_browser(("Embedded Browser"))

node_user -->|"sends commands"| node_driver
node_driver -->|"binds commands"| node_commands
node_driver -->|"locates elements"| node_selectors
node_driver -->|"converts CSS"| node_css
node_driver -->|"sends RPC"| node_serverclient
node_serverclient -->|"spawns server"| node_nativeentry
node_nativeentry -->|"starts server"| node_rpc
node_rpc -->|"dispatches methods"| node_dispatcher
node_dispatcher -->|"uses session"| node_session
node_dispatcher -->|"routes searches"| node_find
node_dispatcher -->|"routes XPath"| node_xpath
node_dispatcher -->|"routes source"| node_pagesource
node_dispatcher -->|"routes patterns"| node_patterns
node_dispatcher -->|"routes accessibility"| node_accessibility
node_dispatcher -->|"routes commands"| node_othercommands
node_dispatcher -->|"routes sessions"| node_sessioncmd
node_sessioncmd -->|"sets session state"| node_session
node_session -->|"initializes UIA"| node_uia
node_sessioncmd -->|"builds conditions"| node_conditions
node_selectors -->|"encodes conditions"| node_conditions
node_find -.->|"searches tree"| node_uia
node_xpath -.->|"evaluates XPath"| node_uia
node_dispatcher -->|"routes plugin calls"| node_plugins
node_plugins -->|"uses provider contract"| node_sdk
node_driver -.->|"supports IE sessions"| node_ieclient
node_ieclient -.->|"communicates with bridge"| node_iebridge
node_driver -.->|"supports hybrid mode"| node_cdp
node_cdp -.->|"automates embedded content"| node_browser
node_commands -.->|"uses native input"| node_winapi
node_winapi -.->|"sends input"| node_desktop
node_uia -.->|"reads UI tree"| node_desktop

click node_driver "https://github.com/appium/appium-wincore-driver/blob/main/lib/driver.ts"
click node_commands "https://github.com/appium/appium-wincore-driver/tree/main/lib/commands"
click node_selectors "https://github.com/appium/appium-wincore-driver/blob/main/lib/uia-selector/parser.ts"
click node_css "https://github.com/appium/appium-wincore-driver/blob/main/lib/css/index.ts"
click node_serverclient "https://github.com/appium/appium-wincore-driver/blob/main/lib/server/client.ts"
click node_ieclient "https://github.com/appium/appium-wincore-driver/blob/main/lib/ie/session.ts"
click node_nativeentry "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Program.cs"
click node_rpc "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/JsonRpcServer.cs"
click node_dispatcher "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/CommandDispatcher.cs"
click node_session "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/State/SessionState.cs"
click node_sessioncmd "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/SessionCommands.cs"
click node_find "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/FindCommands.cs"
click node_xpath "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/XPathCommands.cs"
click node_pagesource "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/PageSourceCommands.cs"
click node_patterns "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/PatternCommands.cs"
click node_accessibility "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/AccessibilityCommands.cs"
click node_othercommands "https://github.com/appium/appium-wincore-driver/tree/main/csharp/WincoreServer/Commands"
click node_uia "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Uia3/UIA.cs"
click node_conditions "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/ConditionBuilder.cs"
click node_sdk "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServerSdk/ITreeProvider.cs"
click node_plugins "https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Plugins/PluginHost.cs"
click node_iebridge "https://github.com/appium/appium-wincore-driver/blob/main/csharp/IEBridge/IEBridge.cs"
click node_cdp "https://github.com/appium/appium-wincore-driver/blob/main/lib/commands/extension.ts"
click node_winapi "https://github.com/appium/appium-wincore-driver/blob/main/lib/winapi/user32.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_driver,node_commands,node_selectors,node_css,node_serverclient,node_user,node_browser toneBlue
class node_nativeentry,node_rpc,node_dispatcher,node_session,node_sessioncmd,node_find,node_xpath,node_pagesource,node_patterns,node_accessibility,node_othercommands,node_uia,node_conditions,node_sdk,node_plugins toneAmber
class node_ieclient,node_iebridge,node_cdp toneMint
class node_winapi toneRose
class node_desktop toneIndigo
```

## Components

### Appium Driver

- [Appium Driver](https://github.com/appium/appium-wincore-driver/blob/main/lib/driver.ts): `lib/driver.ts`
- [Driver Commands](https://github.com/appium/appium-wincore-driver/tree/main/lib/commands): `lib/commands`
- [Selector Processing](https://github.com/appium/appium-wincore-driver/blob/main/lib/uia-selector/parser.ts): `lib/uia-selector/parser.ts`
- [CSS Conversion](https://github.com/appium/appium-wincore-driver/blob/main/lib/css/index.ts): `lib/css/index.ts`
- [Server Client](https://github.com/appium/appium-wincore-driver/blob/main/lib/server/client.ts): `lib/server/client.ts`

### Native Automation Server

- [Server Entry](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Program.cs): `csharp/WincoreServer/Program.cs`
- [JSON-RPC Server](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/JsonRpcServer.cs): `csharp/WincoreServer/Server/JsonRpcServer.cs`
- [Command Dispatcher](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/CommandDispatcher.cs): `csharp/WincoreServer/Server/CommandDispatcher.cs`
- [Session State](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/State/SessionState.cs): `csharp/WincoreServer/State/SessionState.cs`
- [Session Setup](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/SessionCommands.cs): `csharp/WincoreServer/Commands/SessionCommands.cs`
- [Element Search](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/FindCommands.cs): `csharp/WincoreServer/Commands/FindCommands.cs`
- [XPath Search](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/XPathCommands.cs): `csharp/WincoreServer/Commands/XPathCommands.cs`
- [Page Source](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/PageSourceCommands.cs): `csharp/WincoreServer/Commands/PageSourceCommands.cs`
- [UIA Patterns](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/PatternCommands.cs): `csharp/WincoreServer/Commands/PatternCommands.cs`
- [Accessibility Values](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Commands/AccessibilityCommands.cs): `csharp/WincoreServer/Commands/AccessibilityCommands.cs`
- [Window And Device APIs](https://github.com/appium/appium-wincore-driver/tree/main/csharp/WincoreServer/Commands): `csharp/WincoreServer/Commands`
- [UI Automation](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Uia3/UIA.cs): `csharp/WincoreServer/Uia3/UIA.cs`
- [Condition Builder](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Server/ConditionBuilder.cs): `csharp/WincoreServer/Server/ConditionBuilder.cs`
- [Provider SDK](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServerSdk/ITreeProvider.cs): `csharp/WincoreServerSdk/ITreeProvider.cs`
- [Plugin Hosting](https://github.com/appium/appium-wincore-driver/blob/main/csharp/WincoreServer/Plugins/PluginHost.cs): `csharp/WincoreServer/Plugins/PluginHost.cs`

### Browser Integrations

- [IE DOM Client](https://github.com/appium/appium-wincore-driver/blob/main/lib/ie/session.ts): `lib/ie/session.ts`
- [IE DOM Bridge](https://github.com/appium/appium-wincore-driver/blob/main/csharp/IEBridge/IEBridge.cs): `csharp/IEBridge/IEBridge.cs`
- [WebView CDP](https://github.com/appium/appium-wincore-driver/blob/main/lib/commands/extension.ts): `lib/commands/extension.ts`

### Windows Platform

- [Windows Input API](https://github.com/appium/appium-wincore-driver/blob/main/lib/winapi/user32.ts): `lib/winapi/user32.ts`

### Other components

- **Automation Client**
- **Windows Application**
- **Embedded Browser**

## Connections

- Automation Client → Appium Driver: sends commands (evidence: `README.md`)
- Appium Driver → Driver Commands: binds commands (evidence: `lib/driver.ts`)
- Appium Driver → Selector Processing: locates elements (evidence: `lib/driver.ts`)
- Appium Driver → CSS Conversion: converts CSS (evidence: `lib/driver.ts`)
- Appium Driver → Server Client: sends RPC (evidence: `lib/driver.ts`)
- Server Client → Server Entry: spawns server (evidence: `lib/server/client.ts`)
- Server Entry → JSON-RPC Server: starts server (evidence: `csharp/WincoreServer/Program.cs`)
- JSON-RPC Server → Command Dispatcher: dispatches methods (evidence: `csharp/WincoreServer/Server/JsonRpcServer.cs`)
- Command Dispatcher → Session State: uses session (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → Element Search: routes searches (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → XPath Search: routes XPath (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → Page Source: routes source (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → UIA Patterns: routes patterns (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → Accessibility Values: routes accessibility (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → Window And Device APIs: routes commands (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Command Dispatcher → Session Setup: routes sessions (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Session Setup → Session State: sets session state (evidence: `csharp/WincoreServer/Commands/SessionCommands.cs`)
- Session State → UI Automation: initializes UIA (evidence: `csharp/WincoreServer/State/SessionState.cs`)
- Session Setup → Condition Builder: builds conditions (evidence: `csharp/WincoreServer/Commands/SessionCommands.cs`)
- Selector Processing → Condition Builder: encodes conditions (evidence: `lib/uia-selector/parser.ts`)
- Element Search → UI Automation: searches tree
- XPath Search → UI Automation: evaluates XPath
- Command Dispatcher → Plugin Hosting: routes plugin calls (evidence: `csharp/WincoreServer/Server/CommandDispatcher.cs`)
- Plugin Hosting → Provider SDK: uses provider contract (evidence: `csharp/WincoreServer/Plugins/PluginHost.cs`)
- Appium Driver → IE DOM Client: supports IE sessions (evidence: `README.md`)
- IE DOM Client → IE DOM Bridge: communicates with bridge (evidence: `README.md`)
- Appium Driver → WebView CDP: supports hybrid mode (evidence: `README.md`)
- WebView CDP → Embedded Browser: automates embedded content (evidence: `README.md`)
- Driver Commands → Windows Input API: uses native input (evidence: `lib/commands/app.ts`)
- Windows Input API → Windows Application: sends input
- UI Automation → Windows Application: reads UI tree (evidence: `README.md`)
