{"id":1841,"date":"2014-10-30T01:04:48","date_gmt":"2014-10-30T05:04:48","guid":{"rendered":"http:\/\/qxf2.com\/blog\/?p=1841"},"modified":"2017-07-06T14:52:10","modified_gmt":"2017-07-06T18:52:10","slug":"naf-issue-mobile-testing","status":"publish","type":"post","link":"https:\/\/qxf2.com\/blog\/naf-issue-mobile-testing\/","title":{"rendered":"What is NAF ?"},"content":{"rendered":"<p>UIAutomatorViewer is a tool to <a href=\"https:\/\/qxf2.com\/blog\/identify-ui-elements-mobile-apps\">inspect and identify UI elements in Android apps<\/a>. 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. <\/p>\n<p>I was messing around with <a href=\"http:\/\/appium.io\/\">Appium<\/a> and <a href=\"http:\/\/web.comhem.se\/petero2home\/droidfish\/\"> DroidFish<\/a> 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:<br \/>\n<a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_mode.gif\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_mode-300x152.gif\" alt=\"notNAF\" width=\"300\" height=\"152\" class=\"aligncenter size-medium wp-image-1843\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_mode-300x152.gif 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_mode-1024x519.gif 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nThe chess board however is slightly different. In the UIAutomatorViewer you can see that NAF is set to true in the Node Details.<\/p>\n<p><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_board.gif\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_board-300x151.gif\" alt=\"chessboard_NAF\" width=\"300\" height=\"151\" class=\"aligncenter size-medium wp-image-1842\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_board-300x151.gif 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_board-1024x516.gif 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>What is NAF ?<\/h3>\n<p>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 &#8211; well, good luck! I hope you have good relations with the developer and can request them to make a change to the application. <\/p>\n<p>As a workaround, I decided to move the chess pieces by using the co-ordinates. This is <b><u>not recommended<\/b><\/u>. The co-ordinates will change for each device you test on. Do not use this approach unless you have no other option. <\/p>\n<p><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f7.gif\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f7-300x150.gif\" alt=\"f7\" width=\"300\" height=\"150\" class=\"aligncenter size-medium wp-image-1844\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f7-300x150.gif 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f7-1024x515.gif 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f5.gif\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f5-300x149.gif\" alt=\"f5\" width=\"300\" height=\"149\" class=\"aligncenter size-medium wp-image-1845\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f5-300x149.gif 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_f5-1024x511.gif 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To assert that the correct move is played, I used the moveList &#8211; which thankfully is not NAF.<br \/>\n<a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_moveList.gif\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_moveList-300x140.gif\" alt=\"moveList_assert\" width=\"300\" height=\"140\" class=\"aligncenter size-medium wp-image-1846\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_moveList-300x140.gif 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2014\/10\/droidfish_moveList-1024x477.gif 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>NOTE:<\/strong> I have reported the same on <a href=\"https:\/\/discuss.appium.io\/t\/how-to-click-inside-a-view-for-which-naf-true-in-the-ui-automator-viewer\/476\">appium-discuss<\/a> with the hopes that there is a better solution.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,15],"tags":[],"class_list":["post-1841","post","type-post","status-publish","format-standard","hentry","category-appium","category-how-to"],"_links":{"self":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/comments?post=1841"}],"version-history":[{"count":12,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1841\/revisions"}],"predecessor-version":[{"id":6389,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1841\/revisions\/6389"}],"wp:attachment":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/media?parent=1841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/categories?post=1841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/tags?post=1841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}