Get your Application Audited for Free.

Please fill in the form below to schedule a call or request an estimate.

WinApp driver with Python for desktop application automation
single,single-post,postid-16752,single-format-standard,ajax_fade,page_not_loaded,,qode-title-hidden,side_area_uncovered_from_content,qode-content-sidebar-responsive,qode-theme-ver-9.5,wpb-js-composer js-comp-ver-4.11.1,vc_responsive
Winapp driver with python

How to use WinApp driver with Python for desktop application automation?

Almost every tester out there is familiar with Selenium WebDriver for automating Web applications, and many are also familiar with Appium for automating Mobile apps. However, not as many are familiar with automation tools for desktop applications. This post will discuss one of the most popular tools in the field of test automation for desktop applications – WinAppDriver.

Winapp is a Product of Microsoft, using this driver we can automate Windows applications, classic Windows applications, universal Windows applications, and mobile applications. We can use this driver on the top of an Appium library.


  • Windows 10 OS
  • Winappdriver.exe
  • Inspect.exe for identifying your element value
  • Appium-Python-Client
  • App for automate
  • Your PC should be on Developer mode (ON)

Why is WinAppDriver preferred over other tools?

  • It uses the WebDriver protocol
  • WinAppDriver is free and developed by Microsoft
  • Easily integrates with existing framework
  • It can run as a standalone app and as a plugin for Appium

What does this mean? Well, it means that if you’re from the web/mobile automation world and you already know how to develop using the WebDriver environment, then the transition to WinAppDriver will be easy, quick and clear for you. As in the WebDriver environment, with WinAppDriver’s environment we will also identify elements with findElement, we will also work with Page Object and we will also use the same methods such as: clear, sendKeys, click, etc.

Configuring the WinAppDriver Environment

There are few steps we’ll have to go through in order to work with WinAppDriver

Step 1: Download and install WinAppDriver from:
(you need to choose the file: WindowsApplicationDriver.msi).
It’s a simple “next-next” installation.

Step 2: Enable “Developer Mode” in our operating system (Win10): Let’s open the Settings menu, go to Update & Settings and choose the option “For Developers” and then click on “Developer Mode” as seen in the image below:


Step 3: Download and install Windows SDK from link below. In order to identify the elements in our Desktop application, we’ll need to use a tool for that, called: inspect.exe. This tool comes as part of the Windows SDK package we will install:


Downloading Appium

You can download the Appium for python from the command below:

pip install Appium-Python-Client

Using Inspect.exe

We will use Inspect tool to identify UI Elements of the application under test. In this example, I’ve opened the Calculator application and tried to identify the elements of this application with Inspect:


Writing the Automation Code

With WinAppDriver you can use a variety of programming languages. In this example, I’ve decided to use Python. Below is the code I used to launch the session to the Calculator application:


Finding UI elements with Inspect.exe

UI elements can be identified mainly using following 2 control locators:

  1. Automation Id
  2. Name
  3. Class Name

Following screenshot demonstrate how and where these locators appear on inspect.exe:


Running Test cases

You must start WinAppDriver first to start the session and then run your code.


Once we reach the step of initiating the driver, we need to turn to the local address (in our example) with port 4723, which is the default port of Appium Server. Now, once our driver has been initiated, we can start working with it in order to execute methods from the familiar WebDriver protocol:


Once we run the code, you will see your test cases in action.

Fleek IT Solutions
[email protected]

Fleek IT Solutions is a leading independent software testing company specializes in providing unbiased and independent software testing services to global organizations and product companies.

    Posted at 14:34h, 21 December Reply

    The calculator opens
    But no digit 9 is clicked for example

    • Fleek IT Solutions
      Posted at 12:17h, 29 December Reply

      The problem has been solved, it is the Appium version problem

      =Install Appium-Python-Client 1.3.0

      The 1.3.0 version can run normally.

  • Naresh
    Posted at 12:55h, 27 April Reply

    Iam unable to launch calculator getting Webdriver exception even after following all the steps.

    • Fleek IT Solutions
      Posted at 13:31h, 27 April Reply

      Can you brief what Webdriver exception are you getting?

      • Naresh
        Posted at 16:26h, 27 April Reply

        Iam trying to access calculator using same code. exception is raised at last line
        In Win app driver I am getting json response as 404 not found.

      • Naresh
        Posted at 16:31h, 27 April Reply

        selenium.common.exceptions.WebDriverException: Message: is the exception Iam getting.
        In win app driver JSON Response is HTTP/1.1 404 Not Found

        • Fleek IT Solutions
          Posted at 16:04h, 28 April Reply

          Try replacing your driver remote connection with this:
          driver = webdriver.Remote(

          Hope this will work for you.

  • Peter K
    Posted at 08:21h, 23 May Reply

    How can I connect a dialog box of an application that is open already to the webdriver?

    • Fleek IT Solutions
      Posted at 11:35h, 23 May Reply

      Using Switch to windows

Post A Comment