Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mobile Test Automation with Appium

You're reading from  Mobile Test Automation with Appium

Product type Book
Published in Jun 2017
Publisher Packt
ISBN-13 9781787280168
Pages 256 pages
Edition 1st Edition
Languages
Author (1):
Nishant Verma Nishant Verma
Profile icon Nishant Verma

Interacting with another app


Most of the time, when we test a mobile application, it requires interaction with another app. For example, an app might need integration with the Contacts app or the SMS app. Sometimes, while testing, we might need to simulate the geo location, which can be done via an external app installed on the device/emulator (or it can even be done using Android adb commands).

When we start an Appium session for testing, generally it is tied to an app as we are passing the app parameter in the desired capabilities, so we can't really pass two apps in the desired capabilities. If we recall our code, we are using this line:

capabilities.setCapability("app", "/Users/nishant/Development/HelloAppium/app/quikr.apk");

One way to switch between the apps is when we know the target app's package name and activity name. Android driver exposes a method, startActivity(Activity activity), which basically takes an activity as input and starts it. So, a sample code snippet to start the Contacts...

lock icon The rest of the chapter is locked
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.
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 €14.99/month. Cancel anytime}