Nikita Minaev
Nikita Minaev

Reputation: 129

How inspect elements in Appium on iOS 10?

I try automate testing mobile applications based on Appium. I've not found gui version for Appium beta there. How can i inspect elements in pages for my mobile apps using Appium? Appium version - 1.6.0-beta3

Upvotes: 2

Views: 8067

Answers (5)

Lishani
Lishani

Reputation: 41

You can use uiautomatorviewer to inspect elements in your mobile application. Follow this path to find the uiautomatorviewer. C:\Users\AppData\Local\Android\android-sdk\tools

If not you can use the appium inspector session to find the elements of your mobile app. For that you have to follow the below steps As a pre condition, you need to have appium desktop client and emulator installed with your laptop.

  1. Open the appium desktop client > click on 'start inspector session' from the top right corner (once you click it a new window will appear)
  2. Now you need to add the relevant capabilities according to your requirements.

desired capabilities

  1. Open your emulator first.
  2. Then click on 'Start Session' button on the bottom of the appium inspector window.
  3. Now you can see there is a mobile window opened with the appium inspector window.

appium inspector window

  1. Go to the emulator and move to the page what ever you want and then move back to the appium inspector window and click 'Refresh Source' icon and it will load the mobile view now you are in with your emulator.

  2. Now in the inspector window in appium. using the 'select element' icon in top you can select the element and after selecting you need to click on 'tap' icon in the right side in the window. Now it will display all the available properties for the highlighted element.

Upvotes: 0

SaiPawan
SaiPawan

Reputation: 1194

You can inspect elements of ios simulator by using accessibility inspector from the xcode or you have to get pagesource and find the required elements.

You can use the ios inspector in the below link.

https://github.com/mykola-mokhnach/Appium-iOS-Inspector

Upvotes: 0

Mani
Mani

Reputation: 1186

There is other way you can inspect the label or accessibility layers in iphone simulator or real devices for the you need to enable inspector in your real device or simulator

Go to Setting -> General -> Accessibility -> Accessibility Inspector [On/Off]

Just switch on the "Accessibility Inspector".

Reference screenshot, how accessibility inspector look like,

enter image description here

Note : If you are unable to see the option means, please enable developer option in device and enable UI automation and try.

Upvotes: 0

JaysonP
JaysonP

Reputation: 149

Currently there is not a GUI inspector like there was for Appium 1.5. You can get the xml however by going:

System.out.println(driver.getPageSource());

From there you just need to interpret the xml and make your xpaths.

This will give you all the information you need to locate elements.

Upvotes: 1

Eugene S
Eugene S

Reputation: 6910

There are different ways you can inspect the elements of an application. First of all that depends on the platform you are using. For Android - UIAutomatorViewer is used and for iOS - Appium Inspector. UIAutomatorViewer is provided as a part of Android SDK manager and Inspector is provided with XCode.

Upvotes: 2

Related Questions