{"id":2765,"date":"2016-08-23T05:40:57","date_gmt":"2016-08-23T05:40:57","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=2765"},"modified":"2016-08-23T05:46:46","modified_gmt":"2016-08-23T05:46:46","slug":"automated-mobile-testing-tools-services","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/miscellaneou\/automated-mobile-testing-tools-services\/","title":{"rendered":"Automated Mobile Testing tools and services"},"content":{"rendered":"<p>Recently I did a research on the tools and services that let you test your apps (iOS, Android, Hybrid\/Web) and here&#8217;s what I found.<\/p>\n<h1>TL;DR<\/h1>\n<p>In case you don&#8217;t have time to read through this and you&#8217;re looking for a quick answer on what to choose; I would go with <a href=\"https:\/\/aws.amazon.com\/device-farm\">AWS Device Farm<\/a>.<\/p>\n<p>It was the only service where the docs actually had clear instructions and the only service where the automated tests actually worked. If for nothing else, I would suggest using their <code>Remote Access<\/code> option, as it&#8217;s really great because it gives you the ability to test your app on the particular device with the particular OS version in real time. This is definitely useful for when a user submits a bug, and you don&#8217;t have the actual device\/OS combination on which you could test.<\/p>\n<p>A notable mention is <a href=\"http:\/\/appium.io\/\">Appium<\/a>, which is perfect if you just want to test on your machine and your simulator. It&#8217;s open source and it even has support in AWS Device Farm.<\/p>\n<h1>Longer version<\/h1>\n<p>Below are my notes about the tools\/services that I&#8217;ve tried.<\/p>\n<h2>AWS Device Farm<\/h2>\n<p>As you&#8217;ve read in the TL;DR, my choice would be AWS Device Farm, so I&#8217;ll take a bit more space here and explain why I liked it the most, and I&#8217;ll showcase the simplest usage.<\/p>\n<p>The official website is <a href=\"https:\/\/aws.amazon.com\/device-farm\">here<\/a> and the official documentation is <a href=\"http:\/\/docs.aws.amazon.com\/devicefarm\/latest\/developerguide\/welcome.html\">here<\/a>.<\/p>\n<p>There are two main ways to use AWS Device Farm:<\/p>\n<ul>\n<li><strong>Automated app testing<\/strong> using a variety of available testing frameworks (they even have a few built-in tests called <em>Fuzz tests<\/em> which create some screenshots and a usage video as well)\n<ul>\n<li>it <strong>supports hybrid apps<\/strong> for both Android and iOS<\/li>\n<li>tests run in paralel on multiple devices<\/li>\n<li>test reports contain:\n<ul>\n<li>high-level results<\/li>\n<li>low-level logs<\/li>\n<li>pixel-to-pixel screenshots<\/li>\n<li>performance data<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>Remote access<\/strong> to devices on which you can load, run, and interact with apps in real time\n<ul>\n<li>allows you to swipe, gesture, and interact with a device through your web browser in real time<\/li>\n<li>details about actions that take place as you interact with the devices<\/li>\n<li>logs and <strong>video capture<\/strong> of the session are produced at the end of the session for your review<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Demo<\/h3>\n<p><a href=\"http:\/\/docs.aws.amazon.com\/devicefarm\/latest\/developerguide\/getting-started.html\">The docs<\/a> for setting this up are really great and straight to the point.<\/p>\n<p>Once you create your first project, you have to <code>Create a new run<\/code>:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/LZuywbY.png\" alt=\"\" \/><\/p>\n<p>Then you have to select the Android\/iOS icon and upload your .apk\/.ipa file:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/iiDBZBz.png\" alt=\"\" \/><\/p>\n<p>In the next step, you have to choose the test type that you would like to use. There are a lot of options, and as a starter (in case you don&#8217;t have your tests ready &#8211; we&#8217;ll cover these below in the Appium section) you can choose the <code>Built-in Fuzz<\/code> test.<\/p>\n<p>In the next step you can select the various devices:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/8FVosGZ.png\" alt=\"\" \/><\/p>\n<p>set some additional options and even pre-install some other apps:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/pC5rePM.png\" alt=\"\" \/><\/p>\n<p>After this, just review the settings and start the test. Tests will run in the background and in parallel on all the devices that you&#8217;ve set. Once this is done you will get an overview like this:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/K7PAG09.png\" alt=\"\" \/><\/p>\n<p>You can view the details of each run on the particular device:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/naYFJYF.png\" alt=\"\" \/><\/p>\n<p>You can view the screenshots, performance:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/jJl6fn9.png\" alt=\"\" \/><\/p>\n<p>And you can even see the video of how the built-in test used your application:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/XhtxBE7.png\" alt=\"\" \/><\/p>\n<p>Sure, these tests are not something on which we should rely on, and that&#8217;s why it&#8217;s great that we can write our own. In the next section, we&#8217;ll shortly cover Appium and why it&#8217;s so great for writing tests.<\/p>\n<h2>Appium<\/h2>\n<p><a href=\"http:\/\/appium.io\/\">Appium<\/a> is a tool that makes automation possible for iOS and Android devices. It&#8217;s architected around four key principles:<\/p>\n<ul>\n<li>You shouldn&#8217;t modify your app in order to test it, as you don&#8217;t want test libraries to affect the operation of your app<\/li>\n<li>You should be able to write your tests in any programming language, using any test runner and framework.<\/li>\n<li>There is already a very successful automation standard, so we should reuse and extend that rather than create an entirely new model.<\/li>\n<li>Mobile automation is for everyone. The best mobile automation tool will be open source, and not just in terms of having its code available for view. It should be governed using open source project management practices, and eagerly welcome new users and contributors.<\/li>\n<\/ul>\n<p>Appium satisfies all these requirements in the following ways:<\/p>\n<ul>\n<li>Appium allows you to automate your Android and iOS apps without code modification because it relies on underlying automation APIs supported by the mobile OS vendors (Apple and Google) themselves. These APIs are integrated into the development process and thus don&#8217;t require any 3rd-party libraries to be embedded in test versions of your apps.<\/li>\n<li>Appium is built around a client\/server architecture, which means Appium automation sessions are HTTP conversations (just as when you use any kind of REST API). This means clients can be written in any language. Appium has a number of clients already written, for Ruby, Java, JavaScript, Python, C#, PHP, Objective-C, and even Perl. Additionally, this means that it doesn&#8217;t matter whether an Appium server is hosted on the same machine as the tests. <\/li>\n<li><a href=\"http:\/\/www.seleniumhq.org\/projects\/webdriver\/\">Selenium WebDriver<\/a> is without a doubt the most widely-known framework for automating web browsers from a user&#8217;s perspective. Its API is well-documented, well-understood, and is already a W3C Working Draft. Appium uses this specification and extends it cleanly with additional, mobile-specific automation behaviors.<\/li>\n<li>Appium is open source. It should be clear from the volume of issues and pull requests that we have a very active community (who also engage with one another on our discussion forum).<\/li>\n<\/ul>\n<p>Few additional learning resources:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=1J0aXDbjiUE\">Youtube 1<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=E1D8PM9kdsI\">Youtube 2<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=E1D8PM9kdsIhttp:\/\/code.tutsplus.com\/tutorials\/introduction-to-ios-testing-with-ui-automation--cms-22730\">Tuts+ Code<\/a><\/li>\n<\/ul>\n<h3>Demo<\/h3>\n<p>Once Appium is installed and running, click the proper OS icon (Droid\/Apple) and select the path to your compressed .ipa file (it is required that you zip the .ipa file):<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/XmDLEQN.png\" alt=\"\" \/><\/p>\n<p>One thing I had to set here as well was the <code>BundleID<\/code>, as it didn&#8217;t work without it (BundleID can be found in your <code>config.xml<\/code> file as the <code>id<\/code> property of the <code>widget<\/code> tag).<\/p>\n<p>Once this is set, you can simply click the <code>Launch<\/code> button. Once the launching is done you&#8217;ll see something like the following in the logs:<\/p>\n<p><code>[Appium] Appium REST http interface listener started on 0.0.0.0:4723<\/code><\/p>\n<p>Then you can click the Magnifier icon:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/7N2dN6v.png\" alt=\"\" \/><\/p>\n<p>which will run your app in the simulator:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/ZHfPZc8.png\" alt=\"\" \/><\/p>\n<p>If you&#8217;re testing Hybrid apps, be sure to set the proper Context:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/t8ZveHh.png\" alt=\"\" \/><\/p>\n<p>The best feature of Appium is that it lets you Record the tasks. To enable it, just click the <code>Record<\/code> button, navigate through the tree like structure and select the actions that you want to perform on the selected tags (Tap, Swipe, Shake, text inserting, etc.), and it generates the test code (in few different languages):<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/Bshdhj0.png\" alt=\"\" \/><\/p>\n<h2>Xamarin test cloud<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.xamarin.com\/test-cloud\">Website<\/a><\/li>\n<li>The installation was surprisingly long<\/li>\n<li>It turned out that once I uploaded my <code>.ipa<\/code> file it threw an error: <code>The .ipa file does not seem to be linked with Calabash framework.<\/code><\/li>\n<li>The <strong>main drawback<\/strong> is that you need to integrate the SDK into the app itself. Something which you don&#8217;t have to do on the AWS Device farm (through Appium [take a look at their four key principles])<\/li>\n<\/ul>\n<h3>Calabash<\/h3>\n<ul>\n<li>Later I figured out that Xamarin test cloud uses Calabash<\/li>\n<li><a href=\"http:\/\/calaba.sh\/\">Callabash<\/a> was developed and open sourced by Xamarin and it is a set of libraries that enable you to write and execute automated acceptance tests which consist of end-user actions like Gestures, Assertions, and Screenshots<\/li>\n<li>Calabash supports (and prefers) Cucumber<\/li>\n<\/ul>\n<h3>Cucumber<\/h3>\n<ul>\n<li><a href=\"https:\/\/cucumber.io\/\">Cucumber<\/a> lets you express the behavior of your app using natural language that can be understood by business experts and non-technical QA staff.<\/li>\n<\/ul>\n<h2>Browserstack<\/h2>\n<p>Browserstack doesn&#8217;t support mobile app testing currently. Here&#8217;s the <a href=\"https:\/\/www.browserstack.com\/question\/655\">official thread<\/a>:<\/p>\n<ul>\n<li>Can I test native apps or install apps on BrowserStack\u2019s physical devices?<\/li>\n<\/ul>\n<blockquote><p>\n  At this time, the mobile devices are available exclusively for cross-browser testing. Mobile app testing is on our roadmap for a later date.\n<\/p><\/blockquote>\n<h2>Sauce labs<\/h2>\n<ul>\n<li><a href=\"https:\/\/saucelabs.com\/\">Website<\/a><\/li>\n<\/ul>\n<p>I&#8217;ve spent some time trying to get their solution to work as they popped up on most of the searches that I&#8217;ve done. However, I can&#8217;t say this was a pleasant experience as the docs seemed to be more like &#8216;Hey, we know how to do this, but if you want we can offer you our consulting support :\/&#8217;.<\/p>\n<p>But, didn&#8217;t like their support as I&#8217;m still waiting for the answer to my question I&#8217;ve sent them. When I got the automated sales email, I followed up with the guy but again he said he couldn&#8217;t help me as he&#8217;s &#8216;only&#8217; sales.<\/p>\n<p>They allow you to upload your executable to their service, but only via terminal. They don&#8217;t have an interface for this on the site as AWS does, nor do they have an overview of the uploaded files.<\/p>\n<p>You run all your tests from a script, and you can then see the screenshots and video of how the tests are interacting with your app:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/NNMSMHQ.png\" alt=\"\" \/><\/p>\n<p>However, the bottom line here is that I wasn&#8217;t too impressed with them.<\/p>\n<h2>Other services<\/h2>\n<p>I have also briefly looked at these services, but they didn&#8217;t seem intriguing enough to pursue any of them further.<\/p>\n<h3>Firebase test lab<\/h3>\n<ul>\n<li><a href=\"https:\/\/firebase.google.com\/docs\/test-lab\/\">Website<\/a><\/li>\n<li>only for Android<\/li>\n<\/ul>\n<h3>eggPlant Mobile<\/h3>\n<ul>\n<li><a href=\"http:\/\/www.testplant.com\/eggplant\/testing-tools\/eggplant-mobile-eggon\/\">Website<\/a><\/li>\n<li>Only image based<\/li>\n<\/ul>\n<h3>Soasta<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.soasta.com\/mobile-testing\/\">Website<\/a><\/li>\n<li>Nothing special. TBH, it seemed like it&#8217;s an older version that&#8217;s not actively developed.<\/li>\n<\/ul>\n<h3>Squish<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.froglogic.com\/squish\/gui-testing\/index.php\">Website<\/a><\/li>\n<li>Seems like a quite stable solution, however only locally and it needs to be implemented in the Xcode\/Android project to work<\/li>\n<\/ul>\n<h3>Testmunk<\/h3>\n<ul>\n<li><a href=\"https:\/\/testmunk.com\/\">Website<\/a><\/li>\n<li>Although very nice interface and the flow is basically as on AWS, it wasn&#8217;t able to run my app (just kept popping errors). I emailed the owners but no reply to date, so&#8230;<\/li>\n<\/ul>\n<h3>Keynote<\/h3>\n<ul>\n<li><a href=\"http:\/\/www.keynote.com\/solutions\/testing\/mobile-testing\">Website<\/a><\/li>\n<li>Asked for Credit Card &#8211; lol, are we in like 2009?<\/li>\n<\/ul>\n<h3>iOS only testing<\/h3>\n<ul>\n<li><a href=\"http:\/\/www.testingwithfrank.com\/\">Frank<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/kif-framework\/KIF\">KeepItFunctional<\/a><\/li>\n<\/ul>\n<h3>Windows only apps<\/h3>\n<ul>\n<li><a href=\"https:\/\/smartbear.com\/\">SmartBear<\/a> &#8211; they have instructions on how to run it on OSX <a href=\"https:\/\/support.smartbear.com\/viewarticle\/67793\/\">via virtualization<\/a> however this still is &#8216;just&#8217; an app like Appium which is open source.<\/li>\n<li><a href=\"http:\/\/www.testing-whiz.com\/\">TestingWhiz<\/a><\/li>\n<li><a href=\"http:\/\/borland.com\/en-GB\/Products\/Software-Testing\/Automated-Testing\/Silk-Test\">SilkTest<\/a><\/li>\n<li><a href=\"http:\/\/www.ranorex.com\/\">Ranorex<\/a><\/li>\n<\/ul>\n<h2>Miscellaneous<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=9YGchzL-yFw\">Test automation trends 2016<\/a><\/li>\n<li><a href=\"http:\/\/sqa.stackexchange.com\/questions\/8570\/experiences-with-automation-of-hybrid-mobile-apps?newreg=6d1ea2d596ca407fa4e309e2cf1ba22c\">StackExchange thread about automated hybrid mobile app testing<\/a><\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>So, yeah, as stated in the TL;DR AWS seems like the most viable solution to me right now. In case you have experience with some other solution, or you disagree with some of the conclusions that I&#8217;ve made, please let me know in the comments.<\/p>\n<p>Also, if someone has extensive experience with writing and running tests on AWS Device Farm via Appium tests, I would love to get your feedback.<\/p>\n<blockquote class=\"twitter-tweet\" data-width=\"550\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/Automated?src=hash\">#Automated<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/mobile?src=hash\">#mobile<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/testing?src=hash\">#testing<\/a> tools and services <a href=\"https:\/\/t.co\/rZpnBVQ9Fh\">https:\/\/t.co\/rZpnBVQ9Fh<\/a> <a href=\"https:\/\/t.co\/Yzbeg2ASya\">pic.twitter.com\/Yzbeg2ASya<\/a><\/p>\n<p>&mdash; Nikola Bre\u017enjak (@HitmanHR) <a href=\"https:\/\/twitter.com\/HitmanHR\/status\/767961053443530752\">August 23, 2016<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I did a research on the tools and services that let you test your apps (iOS, Android, Hybrid\/Web) and here&#8217;s what I found. TL;DR In case you&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-2765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneou"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=2765"}],"version-history":[{"count":3,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2765\/revisions"}],"predecessor-version":[{"id":2798,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2765\/revisions\/2798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/2796"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=2765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=2765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=2765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}