Windows application (Desktop) automation with Winium

There are lots of different automation tools and frameworks are available for windows applications (mainly for desktop application ) like – Sikuli, AutoIt, CodedUI, Winium etc. I have gone through all of them for desktop application (windows) automation for testing. All of them have different advantages and disadvantages.

Among all of them i found ‘winium’ the most easy and handy automation framework for desktop application . It’s completely my personal opinion.In this post i am going to describe the following things-

1.What is winium

2.Why it is better than other tools (according to me)

3.How to set up the whole environment for using winium

4.Some example


Winium is an automation framework for windows platform. It is free, opensource and most importantly it is selenium based.

Why Winium: 

  • With winium we can write our test with any language that’s compatible with webdriver such as – Java, Objective-C, JavaScript with Node.js (in promise, callback or generator flavors), PHP, Python, Ruby, C#, Clojure, or Perl with the Selenium WebDriver API and language-specific client libraries.
  • we can use any testing framework with it
  • Supported platforms – Windows Desktop (WPF, WinForms) Apps,Windows Store or Universal Apps for Windows Phone,Windows Phone Silverlight Apps

Here our main focus is winium for desktop

Winium.Desktop is Selenium Remote WebDriver implementation for automated testing of Windows application based on WinFroms and WPF platforms.

Supported Platforms

  • WinForms
  • WPF


  • Microsoft .NET Framework 4.5.1

Steps to setup the environment:

  • First we need to set up .NET Framework 4.5.1 in our system
  • Then go to the following address to download winium.desktop.exe –
  • All other libraries we are going to download through maven, below i am giving my maven dependencies
<pre><?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""










To initiate the winium driver

public WiniumDriver setupEnvironment() throws IOException {

    String outlookApplicationPath = "C:\\ProgramfileS|\...\..\outlook.exe";
    String winiumDriverPath = "C:\Progra...\..\winium.desktop.exe";

    options = new DesktopOptions(); //Initiate Winium Desktop Options
    options.setApplicationPath(outlookApplicationPath); //Set outlook application path

    File drivePath = new File(winiumDriverPath); //Set winium driver path

    service = new WiniumDriverService.Builder().usingDriverExecutable(drivePath).usingPort(9999).withVerbose(true).withSilent(false).buildDesktopService();
    service.start(); //Build and Start a Winium Driver service
    driver = new WiniumDriver(service, options); //Start a winium driver

    return driver;


This block of code will create the driver to communicate with our application. Rest of the things are like automating a web application with selenium. We are going to use basic selenium commands like “findElementBy.sendKeys()” or “” etc.

Example – adding two number with the calculator application in windows

public void addNumberTest() throws InterruptedException {

    WebElement calcFrame = driver.findElement(By.className("CalcFrame"));
    WebElement menu = driver.findElement("MenuBar"));
    WebElement viewMenu = menu.findElement("View"));;

To find the element properties of a windows application we will use “Inspect.exe” which is available by default in windows if not just download it.It gives all the properties of a desktop application to control it


Winium is much handy tools for automating windows application as it is selenium based. We are very much familiar with selenium based commands so  it is very easy for us to work with winium.And it is pretty fast comparing to other tools i think.

Resource links –


One thought on “Windows application (Desktop) automation with Winium

Add yours

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: