Tag Archives: UI testing

Windows at Microsoft Connect(); // 2016

During the Connect(); // 2016, the Windows team talked about the Universal Windows Platform and about some of the great tooling improvements that have happened in recent months.

Kevin Gallo, VP and Program Manager Director of the Windows Platform team, was joined by Mazhar Mohammed and Dave Alles for an hour-long panel discussion and Q&A on Channel 9. Mazhar is the Director of Partner Services of for the Windows Store team, and Dave is the Group Program Manager for the team that created the Maps app for Windows.

Check out the video below to see the interesting conversation between leaders of the teams that create the Windows Platform and the Store, and one of the teams that uses both in creating a major Windows app. Kevin talks about why developers should target UWP, while Mazhar discusses the constant improvements in the Store and Dev Center. Dave talks about what a 1st-party app thinks about new features, and interacts with the platform team to provide feedback and request functionality. This is actually very similar to the way external developers provide input and feedback via UserVoice!

In the keynote, Stacey Doerr joined Scott Hanselman on stage to talk about automated UI testing of Windows apps using WinAppDriver and Appium. This isn’t just for testing UWP apps, but all Windows applications, including applications built in VB6 or Delphi and more. For more details about WinAppDriver, check out Yosef’s in-depth blog post: Windows Application Driver for PC integrates with Appium. Scott also has a great overview on getting started tested on Windows with Appium.

The Windows teams also did the following four presentations to provide deeper dives into the Desktop Bridge and a set of new and improved developer tooling capabilities:

Windows Application Driver for PC integrates with Appium

The most time consuming and expensive part of developing an app is often the testing phase. Manually testing an app on hundreds of different devices is impractical, and existing automation solutions run into a number of platform and tooling limitations. Appium is designed to simplify testing by supporting multiple platforms, and it’s our goal at Microsoft with Windows Application Driver (WinAppDriver) to enable you to use Appium to test Windows apps. The recent release of Appium v1.6 integrates WinAppDriver so developers can run tests targeting Windows 10 PC applications through Appium!

What is WinAppDriver?

WinAppDriver is a modern, standards-based UI test automation service that aligns with the Selenium WebDriver Protocol The Windows Application Driver allows a developer to use the “write a test once, run anywhere” approach. No longer forced to choose a specific test language and runner, developers are granted flexibility and no longer need to rewrite tests for each platform.

What is Selenium/Appium?

Selenium is the industry standard for automated UI testing of websites/browser applications. Selenium works off of the WebDriver protocol, which is an open API for browser automation. Realizing that this same protocol could be leveraged for mobile app UI testing, the Appium project was created, and it extended the WebDriver API to allow for app-specific automation endpoints. WinAppDriver was created in the spirit of the Selenium/Appium projects to conform to the industry standards for UI testing and bring those standards to the Universal Windows Platform.

How it works

screen-shot-2016-11-15-at-5-12-47-pm

With Appium’s integration of WinAppDriver, developers will have full customization of their preferred testing language and test runner as shown in the diagram above—and they can reuse their tests if their app is on iOS and Android. It is only through Appium that developers can have this customization – each UWP developer might prefer a different test script/test runner for their UI tests and because Appium uses the Webdriver protocol, developers can have that flexibility when authoring tests.

What about CodedUI?

The current UI test automation solution for Windows app testing is CodedUI; however, Coded UI only works for apps running on the Windows platform. For developers who write cross-platform apps, this means they have to write tests for each platform they are targeting. Additionally, those developers who write cross-platform apps will have to write custom tests for each platform they are targeting.

With Appium supporting multiple platforms like Android and iOS, Microsoft encourages customers to use Selenium and Appium for Functional UI testing.

How can I get started?

To download Appium with Windows 10 PC support, make sure you have Node version >=6.0 and npm version >=3.5. Then use the following steps:

  1. In your command prompt, run npm install –g appium
  2. Then, run the command appium from an elevated command prompt
    1. Make sure developer mode is on as well
  3. Choose a test runner (Visual Studio, IntelliJ, Sublime Text etc.) and a language to test in (C#, Ruby, Python, etc.)
  4. Create a test targeting a Windows application of your choice.
    1. Set the URL targeting your Appium server, and the appId capability set to the app ID of the app you are testing.
    2. The platformName capability should be set to “Windows” and the deviceName capability set to “WindowsPC” in the test script.
  5. Run your test from the test runner targeting the Appium server URL

Here is a screenshot of what the install process looks like from the command line:

picture1

As part of the install, you should see that WinAppDriver is downloaded and successfully installed:

picture2

Then, just run Appium from the command line:

picture3

Now that the Appium server is running, you can run a test from your choice of test runner pointing to the Appium endpoint. In this example, we’ll use a test targeting the built-in Calculator app on Windows 10.

picture4

The key components (shown in the red boxes) are setting the URL to target the Appium server, as well as setting the app ID, platformName and deviceName as explained in the earlier instructions.
Once you run the test, you should see results in the test runner.

picture5

To see sample tests, check out the sample apps/tests on the WinAppDriver Github page or in the Appium samples repo. For more information about WinAppDriver + Appium, visit Appium’s website or their GitHub, or check out these videos talking about how Appium and UI test automation works.

Panel with Jonathan Lipps from SauceLabs
UI Test Automation for Browsers and Apps Using the WebDriver Standard