Book Image

Appium Essentials

Book Image

Appium Essentials

Overview of this book

Table of Contents (14 chapters)

Finding elements for iOS web-based apps using Safari's Develop option


Safari comes with a built-in solution for finding the elements for web apps, but we need to perform the following steps in order to set up the device for remote debugging:

  1. Navigate to Settings | Safari | Advanced:

  2. Then, turn on Web Inspector:

  3. Open the Safari browser on your device/simulator and navigate to the desired URL (we are navigating to www.google.com).

  4. Now, go to your Mac Safari browser, click on the Develop option from the menu, select the device/simulator (assuming that the device is connected to your Mac), and click on the URL:

  5. Now you will get the following screen with the HTML source code:

Now, we can easily inspect elements with Safari DevTools.

Finding elements by ID

To interact with the web page, first we need to find an element on the page. All the functions of the Appium client library need an element to perform the actions on the web page.

Finding an element by ID is used to locate only one element in the mobile...