Cannot perform click action on android mobile

Hi Guys,

Now i am working on XaioMi android mobile. When i am trying to execute click action on APP, there’s no response on the APP, the appium doesn’t click the element.

Android version: 6.0.1
Appium version: 1.6.5
Platfrom version: Mac
Below is the log on command line:

[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/suziying/Documents/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“ef74efcd”,“shell”,“am”,“start”,"-W","-n",“com.ffan.exchange/com.ffan.exchange.business.startpage.activity.StartPageActivity”,"-S","-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]
[Appium] New AndroidDriver session created successfully, session 8df3ae96-b60d-4977-a88e-8f18e5a6564d added to master session list
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1501826672248 (14:04:32 GMT+0800 (CST))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”},“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”,“deviceUDID”:“ef74efcd”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“MI 5”,“deviceManufacturer”:“Xiaomi”}
[HTTP] <-- POST /wd/hub/session 200 8224 ms - 905
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: [“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [MJSONWP] Responding to client with driver.getSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”},“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”,“deviceUDID”:“ef74efcd”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“MI 5”,“deviceManufacturer”:“Xiaomi”}
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d 200 4 ms - 905
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: [“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [MJSONWP] Responding to client with driver.getSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”},“app”:"/Users/suziying/Documents/workspace/exchange/resources/test.apk",“appPackage”:“com.ffan.exchange”,“appActivity”:“com.ffan.exchange.business.startpage.activity.StartPageActivity”,“platformVersion”:“6.0.1”,“platformName”:“Android”,“deviceName”:“ef74efcd”,“deviceUDID”:“ef74efcd”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“MI 5”,“deviceManufacturer”:“Xiaomi”}
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d 200 7 ms - 905
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:10000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,10000,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 3 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/elements {“using”:“class name”,“value”:“android.widget.Button”}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: [“class name”,“android.widget.Button”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[]}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 15 ms so far
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[]}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 550 ms so far
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 1087 ms so far
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[]}
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“context”:"",“multiple”:true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Button’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (1)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (2)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=2]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (3)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=3]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (4)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=4]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (5)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.Button, INSTANCE=5]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:[{“ELEMENT”:“1”},{“ELEMENT”:“2”},{“ELEMENT”:“3”},{“ELEMENT”:“4”},{“ELEMENT”:“5”}]}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.findElements() result: [{“ELEMENT”:“1”},{“ELEMENT”:“2”},{“ELEMENT”:“3”},{“ELEMENT”:“4”},{“ELEMENT”:“5”}]
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/elements 200 3776 ms - 153
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/1/text {}
[debug] [MJSONWP] Calling AppiumDriver.getText() with args: [“1”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“1”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“首页”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.getText() result: “首页”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/1/text 200 61 ms - 80
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/2/text {}
[debug] [MJSONWP] Calling AppiumDriver.getText() with args: [“2”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“2”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“2”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“行情”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.getText() result: “行情”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/2/text 200 32 ms - 80
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/3/text {}
[debug] [MJSONWP] Calling AppiumDriver.getText() with args: [“3”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“3”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“3”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“账户绑定”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.getText() result: “账户绑定”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/3/text 200 33 ms - 86
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/4/text {}
[debug] [MJSONWP] Calling AppiumDriver.getText() with args: [“4”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“4”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“4”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“财富中心”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.getText() result: “财富中心”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/4/text 200 42 ms - 86
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/5/text {}
[debug] [MJSONWP] Calling AppiumDriver.getText() with args: [“5”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“5”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“5”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“我的”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.getText() result: “我的”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/5/text 200 34 ms - 80
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:10000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,10000,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 2 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:0}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,0,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 0ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 3 ms - 76
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: “NATIVE_APP”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/context 200 2 ms - 84
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element {“using”:“id”,“value”:“com.ffan.exchange:id/btn_tab_home”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“com.ffan.exchange:id/btn_tab_home”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.ffan.exchange:id/btn_tab_home”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.ffan.exchange:id/btn_tab_home”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘com.ffan.exchange:id/btn_tab_home’ using ‘ID’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.ffan.exchange:id/btn_tab_home]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“6”}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“6”}
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element 200 25 ms - 87
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:5000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,5000,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 5000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 3 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/6/click {“id”:“6”}
[debug] [MJSONWP] Calling AppiumDriver.click() with args: [“6”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“6”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“6”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/6/click 200 32 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:5000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,5000,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 5000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 4 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:0}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,0,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 0ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 3 ms - 76
[HTTP] --> GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: “NATIVE_APP”
[HTTP] <-- GET /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/context 200 4 ms - 84
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element {“using”:“id”,“value”:“com.ffan.exchange:id/btn_tab_home”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“com.ffan.exchange:id/btn_tab_home”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.ffan.exchange:id/btn_tab_home”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.ffan.exchange:id/btn_tab_home”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘com.ffan.exchange:id/btn_tab_home’ using ‘ID’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.ffan.exchange:id/btn_tab_home]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“7”}
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element 200 21 ms - 87
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“7”}}
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts {“type”:“implicit”,“ms”:5000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,5000,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [BaseDriver] Set implicit wait to 5000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/timeouts 200 4 ms - 76
[HTTP] --> POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/7/click {“id”:“7”}
[debug] [MJSONWP] Calling AppiumDriver.click() with args: [“7”,“8df3ae96-b60d-4977-a88e-8f18e5a6564d”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“7”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“7”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/8df3ae96-b60d-4977-a88e-8f18e5a6564d/element/7/click 200 31 ms - 76
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [AndroidDriver] Shutting down Android driver

1 Like

This is my test script:
import io.appium.java_client.MobileDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import org.openqa.selenium.support.PageFactory;

import java.util.concurrent.TimeUnit;

public class Android_FrontPage {

protected AndroidDriver driver;
public Android_FrontPage(MobileDriver driver) {
    this.driver = (AndroidDriver) driver;
    PageFactory.initElements(new AppiumFieldDecorator(driver,5, TimeUnit.SECONDS),this);
}

@AndroidFindBy(id = "com.ffan.exchange:id/btn_tab_home")
public AndroidElement bottom_FrontPage;

public void clickBottomFrontPage() {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    bottom_FrontPage.click();

}

}

Anyone can help this ? Really appreciate

change it to

@AndroidFindBy(id = “btn_tab_home”)

Also make it sure -

  1. The element id is correct
  2. that you are trying to click on the element while the element is visible on the screen

Appium can’t find elements if they are not visible on the screen (for Android)

Hi @Umar_Khan
Thanks for your help. But it doesn’t work when i changed the id based on your suggestion. Below are the screenshots.

@suroit when you tries:

try {
  bottom_FrontPage.click();
} catch (Exception e) {
  System.out.println(driver.getPageSource());
}

can you find in output your “btn_tab_home” ?

Hi @Aleksei Thanks for your reply.
Below is the screenshot after running.

It’s wired that as you can see on the screenshot, the appium try to use UiSelector[INSTANCE=0, RESOURCE_ID=com.ffan.exchange:id/(“btn_tab_quotation”] to locate the element and this attribute is same with the code in my script.

@suroit you mentioned the code of “Android_FrontPage” but did not mention the test code where you use this. pls add.

Android_FrontPage:

package com.ffan.pagefactory;

import io.appium.java_client.MobileDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import org.openqa.selenium.support.PageFactory;

import java.util.concurrent.TimeUnit;

public class Android_FrontPage {

protected AndroidDriver driver;
public Android_FrontPage(MobileDriver driver) {
    this.driver = (AndroidDriver) driver;
    PageFactory.initElements(new AppiumFieldDecorator(driver,10, TimeUnit.SECONDS),this);
}

@AndroidFindBy(id = "(“btn_tab_quotation”")
public AndroidElement bottom_HQ;

public void clickBottomFrontPage() {
    try {
        bottom_HQ.click();
    } catch (Exception e) {
        System.out.println(driver.getPageSource());
    }

}

}

AppTest:

package com.ffan.test;

import com.ffan.common.InitDriver;
import com.ffan.pagefactory.Android_FrontPage;
import com.ffan.utils.LogUtil;
import io.appium.java_client.MobileBy;
import io.appium.java_client.MobileDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.By;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

/**

  • Unit test for simple App.
    /
    public class AppTest
    {
    /
    *

    • Create the test case
      */

    private InitDriver initDriver;
    private MobileDriver driver;

    @BeforeTest()
    public void setUp() throws MalformedURLException {
    initDriver = new InitDriver();
    initDriver.setUp(“android”);
    driver = initDriver.getMobileDriver();
    }

    @Test
    public void test() {
    LogUtil.startTestCase(AppTest.class.getName());
    Android_FrontPage android_frontPage = new Android_FrontPage(driver);
    android_frontPage.clickBottomFrontPage();
    }

    @AfterTest()
    public void shutDown() {

    }

}

@AndroidFindBy(id = “(“btn_tab_quotation””) - is not correct

->

@AndroidFindBy(id = “btn_tab_quotation”)

Really appreciate, that’s too stupid mistake. However when i correct my code, it still doesn’t work.

Below is the latest code. But still doesn’t work …

package com.ffan.pagefactory;

import io.appium.java_client.MobileDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import org.openqa.selenium.support.PageFactory;

import java.util.concurrent.TimeUnit;

public class Android_FrontPage {

protected AndroidDriver driver;
public Android_FrontPage(MobileDriver driver) {
    this.driver = (AndroidDriver) driver;
    PageFactory.initElements(new AppiumFieldDecorator(driver,10, TimeUnit.SECONDS),this);
}

@AndroidFindBy(id = "btn_tab_quotation")
public AndroidElement bottom_HQ;

public void clickBottomFrontPage() {
    try {
        bottom_HQ.click();
    } catch (Exception e) {
        System.out.println(driver.getPageSource());
    }

}

}

@suroit just wonder if try:

@AndroidFindBy(uiAutomator = "new UiSelector().resourceIdMatches(\".*id/btn_tab_quotation\"))") 
public AndroidElement bottom_HQ;

?

Looks like i got some parsing error

@suroit correct is - https://screencast.com/t/MEYxkAeyW7

Thanks @Aleksei But the appium do nothing with this element … …

@suroit we got progress that we found element to tap. no let’s try tap:

// first lets check where we going to tap
int x,y;
x =  bottom_HQ.getCenter().getX();
y =  bottom_HQ.getCenter().getY();
System.out.println("going to tap at: x - " + x + ", y - " + y);

// do native tap
new TouchAction((MobileDriver) driver).tap(bottom_HQ).perform();

// if this will not help lets try by: x, y
new TouchAction((MobileDriver) driver).tap(x, y).perform();

Thanks @Aleksei I have tried
new TouchAction((MobileDriver) driver).tap(x, y).perform();

However i got some INJECT_EVENTS permission denied error.