Automate Universal Windows Platform (UWP) Application in Visual Studio using Appium

Universal Windows Platform, commonly knows as UWP. Microsoft provides a single app development framework which can be
deployed to multiple devices which run on windows 10 devices like phone/surface/PC etc. In this topic we would go through the UWP

automation of the 'News App'(Desktop) using the Appium framework. Appium is a open source test automation tool for mobile apps.

The winappdriver uses the default selenium properties. Appium uses selenium API to automation the UI elements.

Tools to be used:
1. Visual Studio
2. Winappdriver - Download from
3. Appium framework from Nuget manager
1. Create a new unit test project.
2. Add the appium framework from nuget manager.
3. Install the UWP app(*.appx) in the device
4. Create test method to perform UI test.
1. Creating a new unit test project in visual studio. Launch visual studio and goto file->new->project.
Select Windows->Test->Unit Test Project.


Add references through nuget manager. Right Click on the solution and click on Manage Nuget Packages. Search for Appium and install it.


After installation, all the references will be added to the project.


Add the below code to the *.cs file. Compile and run the test using the test explorer. Ensure the winappdriver.exe is running

parallel'ly for execution. This is available @ C:\Program Files (x86)\Windows Application Driver



namespace News_Appium
 public class NewsTest
 protected const string WindowsApplicationDriverUrl = "";
 protected static WindowsDriver<WindowsElement> NewsApp;
 protected static WindowsDriver<WindowsElement> DesktopSession;

 public static void Setup(TestContext context)
 DesiredCapabilities appCapabilities = new DesiredCapabilities();
 appCapabilities.SetCapability("app", "Microsoft.BingNews_8wekyb3d8bbwe!AppexNews");
 NewsApp = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities);
 DesiredCapabilities desktopCapabilities = new DesiredCapabilities();
 desktopCapabilities.SetCapability("app", "Root");
 DesktopSession = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), desktopCapabilities);

 public static void TearDown()

 public void TopNav()
 NewsApp.FindElementByName("My News").Click();
 NewsApp.FindElementByName("My Sources").Click();
 string text = NewsApp.FindElementByName("Your News. Your Sources.").Text.ToString();
 Assert.AreEqual("Your News. Your Sources.", text);
 NewsApp.FindElementByName("Top Stories").Click();
 NewsApp.FindElementByName("Good News").Click();
 AppiumWebElement searchbox = NewsApp.FindElementByName("Search");
 string txtBlock = NewsApp.FindElementByClassName("TextBlock").Text;
 Assert.AreEqual(txtBlock, "Microsoft");

Compile the code and run the test using the test explorer The above code will use the News App Pre-installed in the windows 10

devices. Or you can use the store app(bing news) to install the app. ''Microsoft.BingNews_8wekyb3d8bbwe!AppexNews" is the app

package name of the bing news app used in the above code.


As the winappdriver is evolving, there would be suffice support from the open source community for any issues. Ex: for sending the text in

the textbox(key+enter), user as to use the escape sequence like \r\n. Like Textbox.sendkeys("Microsoft\r\n").

You can always check the updated versions in

Comments (1)

  1. imitazione anelli cartier love says:

    I am regular reader, how are you everybody? This post posted at this site is actually pleasant.|

Skip to main content
Feel free to leave a feedback !