Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Android Automation Testing with Espresso

DZone's Guide to

Android Automation Testing with Espresso

Espresso testing framework for Android apps lets you write concise, reliable UI tests. pCloudy.com lets you run these scripts on multiple mobile devices.

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Now you can run your Espresso Scripts on hundreds of mobile devices over pCloudy.com.

Espresso is a testing framework for Android apps. The platform allows you to write concise and reliable Android UI tests. pCloudy.com provides you the platform to run these scripts on multiple mobile devices of your choice.

Here are the steps for running your test scripts on multiple Android devices:

  • Login at www.pcloudy.com with your registered Email ID & Password.
  • Choose Instrumentation Type based on the test scripts you’ve written. pCloudy provides support for Instrumentation Type. You can use (InstrumentationTestRunner, AndroidJUnitRunner) for Android. For more information, see Instrumentation in the Testing Fundamentals section of the Android Developer Tools documentation.
  • Go to the Automator Page.
  • Select your Android OS version & manufacturer.
  • Choose Espresso (to run Espresso Scripts).
  • Select Instrumentation Type (TestInstrumentationRunner/AndroidJUnitRunner).
  • Select the application .apk file (the app to be tested).
  • Select the test script .apk file (the Test Script developed for testing).
  • Enter single device execution time (time required for the entire script to be executed on single device).
  • Enter the name of your test cycle (this name will represent your test cycle).
  • Click on Schedule Test Cycle.

Espresso Automation Execution

In the next step, you need to confirm the schedule of the test automation. Here, you can see your selected application, test script, device, etc.

Confirm Test Cycle

Further, you'll get a pop-up message of your test automation schedule confirmation.
Click on OK to proceed.

Test Cycle Scheduling Successful

Go to your mailbox and open the pCloudy Automation Alert mail.
Click on the given link, “Click to View Report."

Report

Finally, you get the result of your scheduled test automation.

Automator Report


Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:
app testing ,espresso ,mobile ,mobile apps ,app development

Published at DZone with permission of Shankar Anamalla. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}