Reader small image

You're reading from  Mobile Test Automation with Appium

Product typeBook
Published inJun 2017
PublisherPackt
ISBN-139781787280168
Edition1st Edition
Tools
Right arrow
Author (1)
Nishant Verma
Nishant Verma
author image
Nishant Verma

Nishant Verma is a co-founder of TestVagrant Technologies. Its a service start-up addressing testing solutions for B2C companies with a focus on mobile and web, and helps companies deliver faster and reliably. Nishant has 11 years of experience in software development and testing. He has worked with IT companies such as ThoughtWorks Inc., Aditi Technologies, and Altisource. He has extensive experience in setting up agile testing practices, functional and non-functional test automation, mentoring, and coaching. In the past, he has worked on web UIs and specializes in building test solutions in the mobile domain. He has hands-on experience with test automation tools such as WebDriver (Selenium2), Calabash, Frank, Appium, Watin, Sikuli, QTP, and DeviceAnywhere. He actively maintains his own website on testing techniques, agile testing, automation techniques, and general learning. He has contributed to leading testing journals such as Testing Circus and Software Developer's Journal, and has been an active speaker at vodQA (testing event of Thoughtworks). Nishant has authored a reference book on how to use Appium for automating Android apps using Java, which is available on Gitbook. It has received close to 200,000 views, 40,000 readers online, and has been downloaded around 3,000 times.
Read more about Nishant Verma

Right arrow

Chapter 13. Appendix

Introduction to Cucumber


In Behavior Driven Development (BDD), the prime focus is on writing acceptance tests that describe the behavior of the application or system. Acceptance tests are written from a customer point of view and hence bring in the outside-in approach to the understanding and testing of the application. The emphasis is on making the test cases readable by everyone on the team so that any stakeholder can give feedback on the application's behavior.

Eric Evans, in his book Domain Driven Design (http://www.amazon.in/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215), talks about the need for one language to bridge the gap between the domain experts and programmers on the team. Cucumber helps enforce the ubiquitous language within the team, which can be understood by anyone on the team. Cucumber tests are written in a language that can be understood by anyone in the team, and it's implementation tests the application. This way, Cucumber helps a team express the...

Finding an app's package name and launch activity


In Chapter 5, we entered Package name and Launch Activity to launch Appium Inspector for an app already installed on the emulator. Let's learn how to find this information from an app.

We can follow two approaches to get the same result. The first approach requires you to have Play Store and the app under test (Quikr in our case) installed on your mobile.

Using the ManifestViewer app

Follow the given steps to find out the package information:

  • Launch the Emulator/Device
  • Launch Google Play Store
  • Search for an app ManifestViewer in Play Store and install it:
  • Once installed, launch the ManifestViewer app
  • Under the Application sections and scroll down to the Quikr app:
  • Once done, tap on the Quikr app, and it will show you these options:
  • Click on the Look the AndroidManifest.xml option
  • This will load the manifest properties, as illustrated:
  • This file will have details like package and activity

Using the Appium GUI app

The second approach to know the package...

Installing Google Play services in the Genymotion emulator


Genymotion is one of the fastest Android emulators available for use. One drawback of using Genymotion is that it comes without the Google Play Store and Google apps. This means that some of the apps for testing that require the Google Play services framework may not work on the emulator.

However, the good news is that we can install Google Play services by following these steps:

  • Start the Genymotion emulator
  • Based on the Android version configured for the emulator, we need to download the flash-able Google Play services gapps-lp-yyyymmdd-signed.zip file from

    This installs Google Play services on the Genymotion emulator.

  • Click on OK and reboot the emulator
  • Once the device is rebooted, you will notice that the Google Apps will start showing in the emulator
  • To install Google Play Store on the device, we need to download the Play Store installer com.android.vending-Major.Minor.Hotfix APK file and install it on the emulator
  • Once done, launch...

Summary


In this Appendix, we covered different topics for a deeper insight into Cucumber. We learned about how Cucumber works and the importance of BDD, and we gained a deep insight into Gherkin and the different keywords Gherkin exposes. We also learned what hooks are and how to use them. We learned the different ways of running Cucumber tests.

We also learned how to look up an Android package name and find out different activities for an app. This is needed when we want to launch the Appium session on a pre-existing app on an Android device. We also learned how we can find the package name and Launch Activity from Appium itself.

We learnt that the Genymotion emulator doesn't come with Google Play services installed. We learned how to flash the device with the Google apps installer file and to install Google Play services on the Genymotion emulator.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mobile Test Automation with Appium
Published in: Jun 2017Publisher: PacktISBN-13: 9781787280168
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Nishant Verma

Nishant Verma is a co-founder of TestVagrant Technologies. Its a service start-up addressing testing solutions for B2C companies with a focus on mobile and web, and helps companies deliver faster and reliably. Nishant has 11 years of experience in software development and testing. He has worked with IT companies such as ThoughtWorks Inc., Aditi Technologies, and Altisource. He has extensive experience in setting up agile testing practices, functional and non-functional test automation, mentoring, and coaching. In the past, he has worked on web UIs and specializes in building test solutions in the mobile domain. He has hands-on experience with test automation tools such as WebDriver (Selenium2), Calabash, Frank, Appium, Watin, Sikuli, QTP, and DeviceAnywhere. He actively maintains his own website on testing techniques, agile testing, automation techniques, and general learning. He has contributed to leading testing journals such as Testing Circus and Software Developer's Journal, and has been an active speaker at vodQA (testing event of Thoughtworks). Nishant has authored a reference book on how to use Appium for automating Android apps using Java, which is available on Gitbook. It has received close to 200,000 views, 40,000 readers online, and has been downloaded around 3,000 times.
Read more about Nishant Verma