Mobile Test Automation with Appium
eBook - ePub

Mobile Test Automation with Appium

Nishant Verma

Partager le livre
  1. 256 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Mobile Test Automation with Appium

Nishant Verma

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Automate your mobile app testingAbout This Book‱ How to automate testing with Appium‱ Apply techniques for creating comprehensive tests‱ How to test on physical devices or emulatorsWho This Book Is ForAre you a mobile developer or a software tester who wishes to use Appium for your test automation? If so, then this is the right book for you.You must have basic Java programming knowledge. You don't need to have prior knowledge of Appium.What You Will Learn‱ Discover Appium and how to set up an automation framework for mobile testing‱ Understand desired capabilities and learn to find element locators‱ Learn to automate gestures and synchronize tests using Appium‱ Take an incremental approach to implement page object pattern‱ Learn to run Appium tests on emulators or physical devices‱ Set up Jenkins to run mobile automation tests by easy to learn steps‱ Discover tips and tricks to record video of test execution, inter app automation concepts‱ Learn to run Appium tests in parallel on multiple devices simultaneouslyIn DetailAppium is an open source test automation framework for mobile applications. It allows you to test all three types of mobile applications: native, hybrid, and mobile web. It allows you to run the automated tests on actual devices, emulators, and simulators. Today, when every mobile app is made on at least two platforms, iOS and Android, you need a tool that allows you to test across platforms.Having two different frameworks for the same app increases the cost of the product and time to maintain it as well. Appium helps save this cost.With mobile app growth exploding, mobile app automation is mainstream now. In this book, author Nishant Verma provides you with a firm grounding in the concepts of Appium while diving into how to set up appium & Cucumber-jvm test automation framework, implement page object design pattern, automate gestures, test execution on emulators and physical devices, and implement continuous integration with Jenkins. The mobile app we have referenced in this book is Quikr because of its relatively lower learning curve to understand the application. It's a local classifieds shopping app.Style and approachThis book takes a practical, step-by-step approach to testing and automating individual apps such as native, hybrid, and mobile web apps using different examples.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Mobile Test Automation with Appium est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Mobile Test Automation with Appium par Nishant Verma en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Mobile Devices. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2017
ISBN
9781787288188

Writing Your First Appium Test

In the last two chapters, we saw what Appium is and how to set up the machine for both Mac OSX and Windows. Now that we have the ecosystem set up, let's start using Appium and writing some actual tests on Appium. In this chapter, we will set up an Appium Java project using IntelliJ and write our first test.
So, the set up we need before we actually write the code is this:
  • Create a sample Java project
  • Add Appium (automation tool) as a dependency
  • Add Cucumber-JVM as a dependency
  • Write a small test for a mobile web
For this example project, we will use Cucumber to write the specification. Cucumber is a tool based on the behavior-driven development framework. We have a separate section in this chapter that briefly talks about Cucumber.
While authoring this book, both the Mac OSX as well as Windows machine support has been included. However, the features of Appium on Windows is not in sync with Mac OS Appium app. Windows users might find the Appium UI option to be missing on certain screens, please do proceed with the most similar option available.

Creating an Appium Java project (using gradle)

Let's create a sample Appium Java project in IntelliJ. This forms the foundation of all the code-related and Appium-related discussions we will have in the subsequent chapters. The following steps help you to achieve this:
  1. Launch IntelliJ and click on Create New Project on the welcome screen.
  2. On the New Project screen, select Gradle from the left pane. Project SDK should get populated with the Java version.
  3. Click on Next, enter the GroupId as com.test and ArtifactId as HelloAppium. The version will already be populated; click on Next.
  4. Check the Use auto-import option and ensure that Gradle JVM is populated. Click on Next. In case the Gradle JVM is not populated, please follow the below steps:
    1. Click on Configure > Project Defaults > Project Structure:
    1. Choose Project under Project Settings as shown below:
    1. Click on New... button.
    2. Point it to the JDK installed on your machine.
    1. Click on OK to close the pop up and go to the new Project creation screen.
  1. The Project name field will be auto-populated with what you gave as ArtifactId. Choose a Project location and click on Finish. IntelliJ will be running the background task (Gradle build), which can be seen in the status bar.
  2. This should create a project with the following structure:
  1. Open the build.gradle file. You will see a message, as shown; click on Ok, apply suggestion!:
  1. Enter the following two lines in build.gradle. This adds Appium and cucumber-jvm under dependencies:
 compile group: 'info.cukes', name: 'cucumber-java', 
version: '1.2.5'
compile group: 'io.appium', name: 'java-client',
version: '5.0.0-BETA6'
  1. Here's how the gradle file should look:
  1. Once done, navigate to View > Tools Windows > Gradle and click on the Refresh all gradle projects icon. This will pull all the dependencies in External Libraries:
  1. Navigate to Preferences > Plugins, search for Cucumber for Java, and click on Install (if it's not previously installed).
  2. Repeat the preceding step for Gherkin and install the same. Once done, restart IntelliJ if it prompts.
Once done, we are ready with the IntelliJ project creation. The next step is to write a Cucumber feature file; however, let's first understand what Cucumber is.

Introduction to Cucumber

Cucumber is a test framework that supports behavior-driven development (or BDD, in short). The core idea behind BDD is domain-specific language (known as DSL) where the tests are written in normal English, expressing how the application or system has to behave. DSL is an executable test that starts with a known state, performs some action, and verifies the expected state:
 Given I launch the app
And I click on Register
Then I should see register with Facebook and Google
Dan North (creator of BDD) defined behavior-driven development in 2009 as --BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting ...

Table des matiĂšres