How to handle the situation when NAF (Not Accessibility Friendly) is true?

Hi, I am testing an Android app to which I do not have source code access. There is one popup in the app I cannot find the elements inside. Using driver.getPageSource() I found that the button which triggers the popup has a property of NAF (Not Accessibility Friendly) set true. So my question is how to overcome this problem?

My initial thought was to find elements by image, however, I think Appium does not support that at the moment, am I right?

Thanks a lot for sharing your thoughts here!

  • Platform: Android
  • Appium version: 1.62
  • Real Device
  • Client langauage (language binding): Java
  • OS: Windows 7
1 Like

I did not notice any update from Appium support team… Only solution is to request Developers to provide some Locators details such that NAF flag set to false(not appeared in Uiautomatorviewer)
I tried with full xpath aswell but when there are more than on element and NAF=true then it is not working.
Wondering why there is no update on this from Support team!!!

When dealing with NAF elements (Not Accessibility Friendly), all it means is that an interactive element (clickable or focusable) has no accessibility data attached to the element/node. Accessibility info includes content description or text. See this question for a good explanation: http://stackoverflow.com/questions/25435878/uiautomatorviewer-what-does-naf-stand-for

NAF doesn’t stop you from automating them by using locators. You can still use XPATHs to query the child element from a unique parent/ancestor element, although it might be a longer XPATH expression than simply pointing straight to a node that is correctly labelled with an ID.

The way to solve this problem is to either:

  1. Ask the developers of the app to add accessibility information to those NAF nodes that unique identify the interactive element.
  2. Work around the lack of unique accessibility information by using locators like Xpaths which can select elements relative to other elements.
2 Likes