We all know using Visual Studio 2013 we can do automated UI testing for Windows Mobile application (built using XAML) with Coded UI , but recently Xamarin
, which is well known for developing Android and IOS native application development using Visual Studio platform has released a new API called Xamarin.UITest
, which will enable automation testing of Android and IOS native application.
Well, if you are new to Xamarin, then you are very late to know about this information, since Microsoft is hugely supporting Xamarin for developing android and IOS application development using its most famous productivity tool visual studio as shown below (screenshot from Xamarin.com)
Setting up test ready Android and IOS application
All you have to do to start your testing for Android application is to
- Create a class library project in Visual Studio 2013
- Go to Nuget Package manager and add package for NUnit and Xamarin.UITest
That’s it!!! You are ready for testing android application using Xamarin with Android application, since Xamarin.UITest has enough accessibility hooks to perform automation.
IOS application Automation
Well, there is one small additional operation we need to do before starting automation with IOS
application is to add this line in the App’s AppDelegate Class
As you can see above code snippet, we are trying to add the Calabash API for testing IOS application, well again, if you don’t know what Calabash is, then to quickly summarize, Calabash
enables you to write and execute automated acceptance tests of mobile apps. Calabash is cross-platform, supporting Android and iOS native apps. It is open source and free. You can check the details out from http://calaba.sh/
As you can see above, Xamarin
is the company which is backing and developing it, but still its open source, which means, you can use it using Cucumber as well.
You can read the article for writing code with Xamarin.UItest from here
Hope you got some idea on working with Android and IOS automation with Visual Studio 2013 !!!