Searching xpath and highlighting elements with Object Spy
Step 1. Open the Testgrid device cloud after login with valid credentials. Connect the real device as shown below.
Step 2. Open your app and and then element inspector as shown in the screenshot below.
Step 3. Now, open any element on clicking it in element inspector. You can choose any random element from the inspector. Once clicked, you will be able to see the Details button in the element inspector page below , click on the Details button. You’ll be able to see all the details related to that element which you have clicked as shown in the screenshot below.
Step 4. Now, we are able to make a XPath with the help of Details provided. Here in this case XPath format will be //android.widget.textView[@text=’Wonders of the world’]. Take this xpath and then search it in element inspector in the upper part of it as shown in the screenshot below. You’ll be able to see all the elements highlighted in yellow color as shown below.
Step 5. We have one more very important feature here know as Object Spy which helps you to highlight the element in yellow color once you click the elements within the app inside the real device. For that you just have to enable Object Spy from inspector page in the upper part and then you are ready to click wherever within the app. Please check as shown in the screenshot below.