10

Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone
Page 2: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Mobile Testing Enterprise Appium Integration

ii Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States.

Mobile Testing Enterprise 8.1

February 2016

Copyright Notice

Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright

Laws of the United States.

Please forward any comments or suggestions about this document to Keynote Support.

Dynatrace LLC

777 Mariners Island Blvd.

San Mateo, CA 94404

Page 3: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Appium Integration Mobile Testing Enterprise

Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States. iii

Contents

1 Overview ............................................................................................................................4

2 Scripting with MTE-Appium Integration ......................................................................4

2.1 Procedure ........................................................................................................................................ 5

2.2 REST API Functions for Scripting ................................................................................................ 6

2.3 Appium Spy .................................................................................................................................... 6 2.3.1 Requirements .................................................................................................................... 7 2.3.2 How to Use Appium Spy ................................................................................................ 7

Page 4: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Mobile Testing Enterprise Appium Integration

4 Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States.

1 Overview

Enterprise customers of Mobile Testing Enterprise 7.1 or higher can integrate with Appium for

automated mobile device testing via Keynote’s web-based version of Studio.

This integration is available for testing native, web, and hybrid apps on private Android and iOS devices

in private/enterprise MTE environments with web Studio.

2 Scripting with MTE-Appium Integration

Users in enterprise deployments of Mobile Testing Enterprise can access Appium integration via the web-

based UI for Studio. The Appium tab appears in the Tools menu of the device console.

Scripting languages supported are:

C Sharp (C#)

Java

Node.js

Figure 2-1 Appium Tab in Web Studio

Page 5: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Appium Integration Mobile Testing Enterprise

Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States. 5

2.1 Procedure

To use the integration:

1 iOS only—sign the application to be tested with a Developer Certificate. If using Keynote’s certificate,

use the Sign and Enable option and upload the app via the Applications tab in the UI.

2 Log in to web Studio and acquire the test device.

3 In the Tools > Appium tab, click Start Appium to generate the Appium connection URL (see the

highlighted text in Figure 2-1).

4 Insert the URL into your Appium script. The URL is valid for the duration of the Appium session.

5 The script must contain the following lines:

capabilities.setCapability(“deviceName”,”anyDevice”)

This line sets up the device on which the test is to be run. The device name anyDevice is

eventually overwritten by the device name in the Appium connection URL inserted into the

script in step 4 above.

Provide information on the application to launch. Use one of the methods shown below:

If the application is already installed on your device, provide the appPackage and

appActivity names (com.expensemanger and

com.expensemenager.ExpenseManager in the example below).

capabilities.setCapability(“appPackage”, “com.expensemanager”);

capabilities.SetCapability(appActivity”,

“com.expensemanager.ExpenseManager”);

If the application is not already installed, install it via Appium from the Mobile Testing

Enterprise repository. The application should already have been added to the repository

using the Install App tab of the device console. Check this link for help on uploading apps.

capabilities.setCapability(“app”,

http://dadportal12qasm.win.keynote.com:8088/app/1001.apk);

Page 6: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Mobile Testing Enterprise Appium Integration

6 Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States.

6 Kick off the Appium automated test script.

7 When done, click Stop Appium in the web Studio UI

2.2 REST API Functions for Scripting

Users can avail of the Mobile Testing Enterprise REST API to help with Appium scripting. The following

API methods are available for Appium scripting:

start-appium—This call starts the Appium server and returns the Appium connection URL

required for insertion into your Appium script in order to connect with your Mobile Testing

Enterprise device.

stop-appium—This call stops the Appium session.

get-application-url—This call returns URL for an application previously uploaded to the

Mobile Testing Enterprise repository. You can pass this URL to an Appium script for application

installation on a device.

stop-appium-with-log—this call stops the Appium session and returns an Appium log file in

ZIP format.

For details, refer to Mobile Testing Enterprise REST API documentation.

2.3 Appium Spy

Users of Mobile Testing Enterprise shared and standalone systems can use Keynote’s integration with a

customized version of the Appium Spy tool for discovering and displaying detailed information about

application objects on Android and iOS devices. You can also record scripts by clicking on the layout.

Page 7: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Appium Integration Mobile Testing Enterprise

Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States. 7

2.3.1 Requirements

Appium Spy is available from Keynote for download and installation on Apple Macintosh computers—

please contact Keynote Support for the customized Appium Spy files. iOS applications must be signed

with an Apple Developer Certificate. Users must be logged in to web Studio to access the Appium

connection URL from the Tools > Appium tab in the device console.

2.3.2 How to Use Appium Spy

1 Copy the customized Appium Spy files onto your Apple Macintosh computer.

2 Log in to web Studio and acquire the test device.

3 In the Tools > Appium tab, click Start Appium to generate the Appium connection URL.

4 Copy the URL leaving out the leading http:// and the trailing /wd/hub/.

5 Double-click to open Appium Spy and select the General Settings Icon.

6 Check Use Remote Server and paste the copied string into the Server Address field.

Page 8: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Mobile Testing Enterprise Appium Integration

8 Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States.

7 With your device still acquired in web Studio, navigate to the Install App tab in the device console.

8 Select the application you want to work with and copy the URL of its repository location.

9 Depending on the device type you are working with, edit the Apple or Android tab to paste the

application URL in the App Path field.

Page 9: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Appium Integration Mobile Testing Enterprise

Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States. 9

For iOS devices, choose the model in the Force Device drop-down list.

For Android devices, also enter a Device Name.

Page 10: Mobile Testing Enterprise 8 - SIGOS€¦ · For details, refer to Mobile Testing Enterprise REST API documentation. 2.3 Appium Spy Users of Mobile Testing Enterprise shared and standalone

Mobile Testing Enterprise Appium Integration

10 Copyright © 2016 Dynatrace LLC. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States.

NOTE You can either paste the application URL in the App Path field to download and install the

application, or you can specify an application already on the device using the Package and Launch

Activity fields.

10 Launch Appium Inspector by clicking the Inspector button and use the object tree to view an

image and details of the selected object.