Page tree
Skip to end of metadata
Go to start of metadata

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


               



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. 

 

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

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.

Working with the Object Spy

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.

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

Mobile Websites - Working with Object Spy 

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

  • No labels