Appium IOS - unable to inspect value with Appium Inspector

When Click on Select, the selection of value is displayed as shown in image. But i can’t able to inspect the value for selection with Appium inspector in MAC. Can anyone help me to identify the value?

What is your tech stack looking like? If it is Appium 1.6.x and Xcode 8 then I suggest you use the built in inspection tool (Accessibility Inspector) and make sure it is pointing to the right device. then hover over that device and that should help you going forward with inspecting other UI elements when attempting to resolve other issues similar to this.

For your immediate issue If you are using 9.3 and above then the picker wheels pattern will now be something like this:

find_element(:class, "XCUIElementTypePickerWheel").send_keys("Other")

In addition to that you can check for the presence of the picker wheel with a check like this:

element_present_by_class?("XCUIElementTypePicker")

I made a method to make checking a lot easier, which I leverage and comes in handy dealing with catching the exceptions and not crashing your tests when an element is not there when you expect it to be there.

def element_present_by_class?(locator, parent=nil)
  start_time = Time.now
  begin
    if parent
      return true if parent.find_element(:class, locator)
    else
      return true if find_element(:class, locator)
    end
  rescue Exception => e
    false
  end
ensure
  #report_timing_information(start_time, "element_present?(locator, parent) - locator: #{locator}, parent object provided? #{parent ? true : false}")
end

The method above checks for the presence of a particular UI element by class but you can easily refactor it to check by :name :accessibility_id or whatever you want. Can also pass it the elements expected parent element to narrow down you search to a specific element.

Hopefully that helps

1 Like