Skip to main content

Mobile Studio - Developing Automated Tests From Your Browser

One of the most challenging things about developing tests for mobile is being able to retrieve a reference to elements in the app structure, whether it is a native app or a mobile website.

Mobile automation mode allows you to extract the XPath of elements using any device (iOS or Android) any application (native or web).

This is done using the built-in object spy.

Open a Device in Automation Mode

To open a device in Automation Mode, refer to Open a device in Automation Mode.

Open a Device in Manual Mode

You can open a device in Manual Mode and then switch back to Automation mode.

To open a device in manual mode:

  1.  Click on the button marked red.
  2. Select the application and then click Start.
info

The "Application(Optional)" dropdown is available only for Appium Projects.

info

By default, system applications won't show in the device's applications list. If needed, there is an option to whitelist system applications to make them show in the list. To do so, add cloud.server.android-system-apps-whitelist to the cloud server application.property file. This property should contain a comma separated list of system applications package names. The system packages in the list will show in devices application list. For example:

cloud.server.android-system-apps-whitelist=com.android.phone,com.sec.android.app.camera

This shows in the list the phone and camera apps in addition to the non-system applications installed on the device.

Launch the Object Spy

To launch the object spy:

  1. Launch an application or a web browser.
  2. Click the Object Spy button in the right side.  An initial dump is generated. You can click Refresh Dump if you switch to other pages or views in your application.

Working with the Object Spy

Native Applications

The object spy allows you to choose elements on the screen to see their position in node hierarchy, as well as view all of their properties.

You can select an element, generate its unique Xpath, or add its XPath to create more complex XPath compositions.

You can then copy-paste the generated XPath and integrate it into your tests.

Mobile Websites

You can also use the Object Spy on mobile websites just like applications. 

To see web dump elements only, change the dump type Web.   

Web Test Development with Appium

To develop tests with Appium projects:

  1. Set the App Focus to Chrome or Safari.

  2. Navigate to the desired website, then click Refresh Dump.

  3. Select the desired web context.

You can now develop your test.

info

You can only fetch Web Dump from the new tab that was opened, Web dump from other tabs will not be returned.

info

The x, y, width, and height attributes of the elements are not from the Appium server and should not be used to identify the elements.

Hybrid Application Test Development with Appium

For more information about Appium projects, see Manage Project Applications.

Hybrid application test development is similar to Web Test Development. To develop a h

  1. Select the Hybrid app from the dropdown as App Under Test. Appium launches the app.
  2. Go to the screen with the Web view element.
  3. Click Refresh Dump to refresh the dump.
  4. Choose the web context.

You can now develop your Hybrid test.

info

Only a single web view is supported for iOS Hybrid Apps.