UIAutomatorViewer is a tool to inspect and identify UI elements in Android apps. However not every UI element you see is accessible to UIAutomatorViewer. Sigh. I know. That sucks. But at the very least, UIAutomatorViewer lets you know which of these elements are not accessible.
I was messing around with Appium and DroidFish secretly hoping to write an automated test that would play out a famous chess game. I noticed that I was able to identify the chessboard but not the individual squares. Most parts of the app were identifiable using UIAutomatorViewer. For example, the buttons are easily identifiable in the UIAutomatorViewer as shown in the image below:
The chess board however is slightly different. In the UIAutomatorViewer you can see that NAF is set to true in the Node Details.
What is NAF ?
NAF means Not Accessible to Framework and only limited information may be available for these components. So if you want to automate a workflow involving a NAF element – well, good luck! I hope you have good relations with the developer and can request them to make a change to the application.
As a workaround, I decided to move the chess pieces by using the co-ordinates. This is not recommended. The co-ordinates will change for each device you test on. Do not use this approach unless you have no other option.
NOTE: I have reported the same on appium-discuss with the hopes that there is a better solution.
My journey as a tester started at Sun Microsystems (now Oracle). I was part of the testing and sustaining team for the Portal Server and Identity Management products. My first assignment was to test the Rewriter module. I enjoyed understanding the big picture, writing test cases, finding bugs and sometimes suggesting the fix too! I was hooked onto testing. Testing felt natural and intuitive to me. I am technically inclined and can write automation in Java, C++, Perl and Python. I am well versed with SilkTest, Selenium, Appium and Selendroid. I am a Computer Science graduate from BITS-Pilani. I love travelling and listening to music.