capabilities.setCapability("deviceName", properties.getProperty("deviceName"));
capabilities.setCapability("platformVersion", properties.getProperty("platformVersion"));
capabilities.setCapability("appPackage", properties.getProperty("appPackage"));
capabilities.setCapability("appActivity", properties.getProperty("appActivity"));
capabilities.setCapability("noReset", "true");
capabilities.setCapability("newCommandTimeout", 60000);
capabilities.setCapability("unicodeKeyboard", "True");
capabilities.setCapability("resetKeyboard", "True");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4725/wd/hub"), capabilities);
WebElement el =drive.findElementById("com.exiu.exiucarowner:id/rb0");
el.click();
[debug] [AndroidDriver] Screen unlocked successfully
[debug] [ADB] Device API level: 24
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/exiulianmeng/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","409ecc4e","shell","am","start","-W","-n","com.exiu.exiucarowner/com.exiu.activity.CarOwnerMainActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[Appium] New AndroidDriver session created successfully, session a69c8532-8abf-4b1b-b975-cb5383ae24bf added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1494916623269 (14:37:03 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":{"appPackage":"com.exiu.exiucarowner","appActivity":"com.exiu.activity.CarOwnerMainActivity","noReset":true,"newCommandTimeout":60000,"platformVersion":"7.0","unicodeKeyboard":true,"platformName":"Android","deviceName":"409ecc4e","resetKeyboard":true},"appPackage":"com.exiu.exiucarowner","appActivity":"com.exiu.activity.CarOwnerMainActivity","noReset":true,"newCommandTimeout":60000,"platformVersion":"7.0","unicodeKeyboard":true,"platformName":"Android","deviceName":"409ecc4e","resetKeyboard":true,"deviceUDID":"409ecc4e","deviceScreenSize":"1080x1920","deviceModel":"MI 5","deviceManufacturer":"Xiaomi"}
[HTTP] <-- POST /wd/hub/session 200 116282 ms - 885
[HTTP] --> POST /wd/hub/session/a69c8532-8abf-4b1b-b975-cb5383ae24bf/timeouts {"type":"implicit","ms":30000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: ["implicit",30000,"a69c8532-8abf-4b1b-b975-cb5383ae24bf"]
[debug] [BaseDriver] Set implicit wait to 30000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/a69c8532-8abf-4b1b-b975-cb5383ae24bf/timeouts 200 4 ms - 76
[HTTP] --> POST /wd/hub/session/a69c8532-8abf-4b1b-b975-cb5383ae24bf/element {"using":"id","value":"com.exiu.exiucarowner:id/rb0"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["id","com.exiu.exiucarowner:id/rb0","a69c8532-8abf-4b1b-b975-cb5383ae24bf"]
[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 30000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","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.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 688 ms so far
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","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.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 6250 ms so far
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","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.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 13121 ms so far
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","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.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waited for 16936 ms so far
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.exiu.exiucarowner:id/rb0","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.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.exiu.exiucarowner:id/rb0' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.exiu.exiucarowner:id/rb0]
^C[Appium] Received SIGINT - shutting down
有没有 遇到相同问题的 ?给个解决方式。