Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
SEO Metadata
titleDeveloping 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.

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.

Opening a Device in Automation Mode

To begin, open a device in automation mode:

  1. From the device choose the device you want to work with.
  2. In the lower hand right corner of the device card, click on the three dots 
  3. Choose Automation

Image Removed

Image Removed


Image Added               Image Added



Alternatively, you can open a device in manual mode and switch to automation mode on the fly.

 Once in manual mode, expand the utilities console. 

Image Added

 Image Added

Then, switch to Automation mode by clicking the button as shown as above.

Image Removed

Image Removed

Image Added

Launch the Object Spy

Once you have switched a device to automation mode, choose your application or launch a web browser.

Find the Object Spy tab in the left hand.

 Once you click on it, an initial dump will be generated. You can click on Refresh Dump if you switch to other pages or views in your application.

Image Removed

Image Added

Working with the Object Spy

The object spy allows you to choose elements on the screen

in order

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

in order

to create more complex XPath compositions.

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

If the view changes, simply click on the object spy again to get the new node hierarchy.

Image Removed

Image Added

Mobile Websites - Working with Object Spy 

The same applies for mobile websites. Simply navigate to the website and launch the object spy.

Image Modified