TWIN : Automating Windows Applications Using Selenium (WebDriver)

TWIN : An Overview

  • TWIN stands for Testing and Automation for Windows Applications
  • Twin is a tool for automating Windows graphical applications.
  • TWIN design is based on the web automation tool Selenium/WebDriver,
  • Twin uses Selenium Grid 2.0 features to automate Windows applications.
  • Twin has a client/server architecture

TWIN : Getting Started

  • Make sure you have .NET framework installed (version 3.0 or above)
  • Download TWIN remote control, unzip on the machine when your AUT is installed and run the sharpclaws executable.
  • Check that the server is running : http://yourmachineIP:4444/
  • Download twin-client-standalone-1.0.jar
  • Start a new java project and add the jar to the project classpath. Create a new class with a Main ()
  • Copy paste below sample code and launch it.
  • You should see notepad starting and a screenshot will be created in the root folder of you project.  

TWIN : Code Snippet

   public static void main(String[] args) throws TwinException, IOException
   {
      Application app = new Application(new URL("http://192.168.39.185:4444")); 
      // URL of the remote control
      app.open("notepad", null);  

      // launch app configured as 'notepad' on remote control, any version
      Window window = app.getWindow();
      window.type("Hello world!");
      window.getScreenshot().save(new File("screenshot.png"));
      app.close();
   }


Download TWIN