Windows Application Driver (WinAppDriver) With C#

Windows Application Driver (WinAppDriver) With C#

What Is Windows Application Driver (WinAppDriver)?

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 apps on Windows 10 PC.

How to Install & Run WinAppDriver?

Windows Application Driver (WinAppDriver) With C#

Open WinAppDriver.exe from the installation directory (C:\Program Files (x86)\Windows Application Driver)

Windows Application Driver (WinAppDriver) With C#

After That, WinAppDriver will be running on the test machine listening to requests on the default IP address and port (

Windows Application Driver (WinAppDriver) With C#

Now you are ready to run any of your Tests Scripts.

Required Packages in Project’s Solutions

We need to add packages ‘Microsoft.WinAppDriver.Appium.WebDriver’ in the current solution from the Nugget as below I have attached the screenshot of the packages.

Windows Application Driver (WinAppDriver) With C#

How to Inspect Elements on Windows Application?

First, we need to Download the Win SDK file from

Windows Application Driver (WinAppDriver) With C#

By using ‘inspect.exe’ we can inspect the element present in the windows application

Windows Application Driver (WinAppDriver) With C#


Windows Application Driver (WinAppDriver) With C#

<?xml version="1.0" encoding="utf-8"?>



            <Parameter name="AppId" value="C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"/>

            <Parameter name="sessionSingletonUrl" value=""/> //When open WinAppDriver You will get this value.



Windows Application Driver (WinAppDriver) With C#
using NUnit.Framework;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Remote;
using System;
using System.Threading;

namespace WinAppDriver
    internal class OutlookDemo
        private static WindowsDriver<WindowsElement> session;

        public void OpenOutlook() {

            DesiredCapabilities appCapabilities = new DesiredCapabilities();
            appCapabilities.SetCapability("app", TestContext.Parameters["AppId"]);    //Getting AppId from test.runsettings. 
            session = new WindowsDriver<WindowsElement>(new Uri(TestContext.Parameters["sessionSingletonUrl"]), appCapabilities);// Getting sessionSingletonUrl  from test.runsettings
            session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
            session.FindElementByName("Send / Receive").Click();

NOTE: Before executing this script you need to select settings to your current project and WinAppDriver c# should be open.

Windows Application Driver (WinAppDriver) With C#

Windows Application Driver (WinAppDriver) Pros

This is an open-source tool. It uses the web driver protocol. It’s free and developed by Microsoft. WinAppDriver can integrate with selenium and Appium projects in the C# language.


WinAppDriver is a very easy-to-use free tool and it is the best option for Automation on Windows applications rather than a paid one, which is easy to integrate and implement with existing automation projects.

Original Source:- Appium WinAppDriver C# Tutorial


Devstringx Technologies 2
Devstringx technologies is the fastest growing and most recommended software development company in Noida, India. We focus on serving high-quality services to b...
In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up

  • Web Application Testing Services

    WHY ARE WEB APPLICATION TESTING SERVICES NEEDED?Nowadays, the competition between all kinds of online services, stores, web applications and websites is fierce....

    Olga B · 10 November 2022 · 12