Running Xamarin.UITests on Local Devices

PDF for offline use:
Related Articles:

Let us know how you feel about this.


0/250
Thanks for the feedback!

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.

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.

Xamarin.UITest does not support Windows Phone.

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.UITest does not support Windows Phone.

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.