O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the Inspector to access the elements

In order to write our tests, we need a way to access the native elements on screen. After that, we should be able to input text on the fields, press the buttons, and run some validations to check that our app is working as expected from our tests.

In this recipe, we will run the Appium Inspector to get an XPath value; we are going to use this value to access the elements in our app through our JavaScript code in the tests.

Getting ready

In order to go through this recipe, it's necessary to complete the first recipe in this chapter. The Appium server should be running, we should have a FormComponents.app file to inspect, and don't forget to plug your phone to your Mac.

Make sure to run the React Native Packager; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required