Top Related Projects
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
A browser automation framework and ecosystem.
Fast, easy and reliable testing for anything that runs in a browser.
Gray box end-to-end testing and automation framework for mobile apps
Quick Overview
Windows Application Driver (WinAppDriver) is an open-source test automation tool for Windows applications. It supports testing Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32) apps using the WebDriver protocol.
Pros
- Cross-platform compatibility: Can be used with various programming languages and test frameworks
- Supports multiple Windows application types (UWP, WinForms, WPF, Win32)
- Integrates well with existing Selenium WebDriver-based test suites
- Active community and regular updates from Microsoft
Cons
- Limited support for some complex UI controls and custom controls
- Performance can be slower compared to native automation frameworks
- Requires Windows 10 or later for full functionality
- Learning curve for developers new to WebDriver-based testing
Code Examples
- Launching a Windows application:
var appCapabilities = new AppiumOptions();
appCapabilities.AddAdditionalCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
var calculatorSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);
- Finding and interacting with elements:
var button1 = calculatorSession.FindElementByName("One");
button1.Click();
var button2 = calculatorSession.FindElementByAccessibilityId("num2Button");
button2.Click();
var resultText = calculatorSession.FindElementByAccessibilityId("CalculatorResults").Text;
- Performing gestures:
var element = calculatorSession.FindElementByName("Element");
var touchActions = new TouchActions(calculatorSession);
touchActions.Scroll(element, 0, 100).Perform();
Getting Started
- Install WinAppDriver from the official GitHub releases
- Start WinAppDriver on the test machine:
C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe
- Create a new test project and add the Appium.WebDriver NuGet package
- Write and run your tests using the WebDriver protocol
For more detailed instructions and examples, refer to the official documentation.
Competitor Comparisons
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Pros of Appium
- Cross-platform support for mobile (iOS, Android) and desktop (Windows, macOS)
- Larger community and ecosystem with more resources and plugins
- Supports multiple programming languages for test scripts
Cons of Appium
- Can be slower and less stable for Windows-specific applications
- More complex setup and configuration process
- Steeper learning curve for beginners
Code Comparison
WinAppDriver:
var desktopSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desktopCapabilities);
var calculator = desktopSession.FindElementByName("Calculator");
calculator.Click();
Appium:
desired_caps = {
'app': 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App',
'platformName': 'Windows',
'deviceName': 'WindowsPC'
}
driver = webdriver.Remote('http://127.0.0.1:4723', desired_caps)
driver.find_element_by_name("Calculator").click()
Both examples demonstrate launching and interacting with the Windows Calculator app. WinAppDriver uses C# and is more Windows-specific, while Appium uses Python and a more generic approach that can be adapted for other platforms.
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Pros of Playwright
- Cross-browser support (Chromium, Firefox, WebKit) vs. WinAppDriver's Windows-only focus
- Supports multiple programming languages (JavaScript, TypeScript, Python, .NET, Java) while WinAppDriver primarily uses C#
- More active development and larger community, with frequent updates and contributions
Cons of Playwright
- Primarily designed for web automation, less suitable for native Windows applications
- Steeper learning curve for those familiar with Selenium-based frameworks like WinAppDriver
- May require additional setup for testing Windows-specific features
Code Comparison
WinAppDriver (C#):
var desktopSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desktopCapabilities);
var calculator = desktopSession.FindElementByName("Calculator");
calculator.Click();
Playwright (JavaScript):
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
})();
Note: The code examples demonstrate the different focus areas of each tool, with WinAppDriver targeting Windows applications and Playwright focusing on web automation.
A browser automation framework and ecosystem.
Pros of Selenium
- Cross-platform support for web automation across multiple browsers and operating systems
- Large, active community with extensive documentation and third-party resources
- Supports multiple programming languages (Java, Python, C#, Ruby, JavaScript, etc.)
Cons of Selenium
- Limited to web applications; cannot automate native desktop applications
- Slower execution compared to native automation tools
- Requires additional setup and configuration for browser drivers
Code Comparison
WinAppDriver (C#):
var desktopSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desktopCapabilities);
var calculatorWindow = desktopSession.FindElementByName("Calculator");
calculatorWindow.FindElementByName("Seven").Click();
Selenium (Java):
WebDriver driver = new ChromeDriver();
driver.get("https://www.example.com");
WebElement element = driver.findElement(By.id("searchInput"));
element.sendKeys("Selenium");
Both WinAppDriver and Selenium provide automation capabilities, but they target different application types. WinAppDriver focuses on Windows desktop applications, while Selenium specializes in web browser automation across multiple platforms. The choice between the two depends on the specific automation requirements of your project.
Fast, easy and reliable testing for anything that runs in a browser.
Pros of Cypress
- Cross-platform support for web applications (Windows, macOS, Linux)
- Built-in debugging tools and real-time reloading
- Extensive documentation and active community support
Cons of Cypress
- Limited to testing web applications only
- Lacks native mobile app testing capabilities
- JavaScript-only test writing, which may be limiting for some teams
Code Comparison
WinAppDriver (C#):
var desktopSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desktopCapabilities);
var calculator = desktopSession.FindElementByName("Calculator");
calculator.Click();
Cypress (JavaScript):
cy.visit('https://example.com')
cy.get('#username').type('testuser')
cy.get('#password').type('password123')
cy.get('#login-button').click()
Key Differences
- WinAppDriver focuses on Windows desktop application testing, while Cypress is designed for web application testing
- WinAppDriver supports multiple programming languages, whereas Cypress is JavaScript-only
- Cypress offers a more user-friendly interface and easier setup process compared to WinAppDriver
- WinAppDriver provides native Windows application testing capabilities, which Cypress lacks
Both tools have their strengths and are suited for different testing scenarios, with WinAppDriver excelling in Windows-specific testing and Cypress offering a robust solution for web application testing across platforms.
Gray box end-to-end testing and automation framework for mobile apps
Pros of Detox
- Cross-platform support for iOS and Android
- Faster test execution due to direct communication with the app
- Active community and frequent updates
Cons of Detox
- Limited support for Windows applications
- Steeper learning curve for developers new to mobile testing
- Requires more setup and configuration compared to WinAppDriver
Code Comparison
Detox (JavaScript):
describe('Example', () => {
it('should tap on a button', async () => {
await element(by.id('myButton')).tap();
await expect(element(by.text('Tapped!'))).toBeVisible();
});
});
WinAppDriver (C#):
[TestMethod]
public void ClickButton()
{
var button = session.FindElementByAccessibilityId("myButton");
button.Click();
Assert.IsTrue(session.FindElementByName("Clicked!").Displayed);
}
The code examples show that Detox uses an async/await pattern with a more fluent API, while WinAppDriver follows a more traditional object-oriented approach. Detox's syntax is generally more concise and readable, but WinAppDriver's approach may be more familiar to developers with experience in desktop application testing.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Windows Application Driver
Windows Application Driver (WinAppDriver) is a service to support Selenium-like UI Test Automation on Windows Applications. This service supports testing Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32) apps on Windows 10 PCs.
Install & Run WinAppDriver
- Download Windows Application Driver installer from https://github.com/Microsoft/WinAppDriver/releases
- Run the installer on a Windows 10 machine where your application under test is installed and will be tested
- Enable Developer Mode in Windows settings
- Run
WinAppDriver.exe
from the installation directory (E.g.C:\Program Files (x86)\Windows Application Driver
)
Windows Application Driver will then be running on the test machine listening to requests on the default IP address and port (127.0.0.1:4723
). You can then run any of our Tests or Samples. WinAppDriver.exe
can be configured to listen to a different IP address and port as follows:
WinAppDriver.exe 4727
WinAppDriver.exe 10.0.0.10 4725
WinAppDriver.exe 10.0.0.10 4723/wd/hub
Note: You must run
WinAppDriver.exe
as administrator to listen to a different IP address and port.
Write an Automation Script
Now that you've successfully installed WinAppDriver, you can get started with authoring your first automation script!
Supported APIs
See here for a list of supported APIs by WinAppDriver. API support may differ from Appium and other counterparts.
FAQ & Documentation
Additional documentation on WinAppDriver and related topics can be found under /Docs/, such as the following:
- Frequently Asked Questions
- Running WinAppDriver in CI (with Azure Pipelines)
- Using UI Recorder
- Authoring Test Scripts
- Using the Selenium Grid
- Running On a Remote Machine
Repository Content
This repository includes the following content:
- Samples - used to showcase various commands and operations such as opening applications, finding elements, clicking elements, typing keystrokes, reading texts, etc; and can be run against built-in Windows 10 applications such as Alarms & Clock, Calculator, and Notepad.
- Tests - used to verify the functionality of Windows Application Driver itself. The tests cover each API endpoints extensively and also against all basic UI control scenario, and demonstrate how to invoke certain command in C#. In addition, they show how to interact with some more complex UI elements such as DatePicker, SplitViewPane, Slider, etc.
- UI Recorder - standalone tool that aims to provide users a simpler way of creating automaton scripts by recording UI events performed by the user and generating XPath queries and C# code on the fly. Read more about it on our Wiki.
- Docs - subdirectory hosting WinAppDriver related documentation.
Vote on New Features
Add your feature request in issues or :+1: (+1) existing issues labeled as Enhancement
Top Related Projects
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
A browser automation framework and ecosystem.
Fast, easy and reliable testing for anything that runs in a browser.
Gray box end-to-end testing and automation framework for mobile apps
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot