Running Xamarin.UITests on Local Devices

PDF for offline use
Related Articles:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2016-10

This guide will discuss how to run Xamarin.UITests on devices attached to your computer.

Overview

Both Xamarin Studio and Visual Studio can run tests on devices attached to your computer. This is very similar to running the tests on an Android emulator or iOS simulator.

This guide will cover how to configure your device for testing and how to run the tests using the IDE.

Requirements

You must first package the APK or IPA before running the test on a local device. The IDE will not build the application bundle prior to running the test.

Xamarin Test Cloud and Xamarin.UITest only support Android and iOS applications. The Windows Phone and Windows versions of Xamarin.Forms apps cannot be tested in Test Cloud.

It is important to understand the concepts described in the Introduction to Xamarin Test Cloud guide.

It is assumed that the most recent stable version of the Xamarin.UITest NuGet Package is installed in the UITest project. It is assume that iOS projects have the most recent version of the Xamarin Test Cloud Agent installed.

In order to run Xamarin.UITests with Xamarin Studio, the following dependencies must be met:
  • NUnit 2.6.x – Xamarin.UITest is not compatible with NUnit 3.x.
  • Android SDK – Only if testing Android apps.
  • Java Developers Kit – Only if testing Android apps.
  • Xcode Command Line Tools – Only for testing iOS apps.
In order to run Xamarin.UITests with Visual Studio, the following dependencies must be met:
  • NUnit 2.6.x – Xamarin.UITest is not compatible with NUnit 3.x.
  • A Test Runner for Visual Studio – A 3rd party test runner, such as the NUnit Test Adapter or Resharper from Jetbrains, is required for Visual Studio to be able to run the NUnit tests.
  • Android SDK – Only if testing Android apps. Windows requires that the ANDROID_HOME environment variable is set with the path to the Android SDK.
  • Java Developers Kit – Only if testing Android apps.

It is not possible to run UITests for iOS apps in Visual Studio or on Windows.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.