Appium click IOS Send email button not working

Environment:

  1. Appium server 1.6.4
  2. Appium desktop client 1.0.1
  3. macOS 10.12.4
  4. Xcode 8.2
  5. IOS 10.2

in our app there is a send email function, when use appium code click the “Send” button, no any interaction, and in the appium log no any error found, when use inspector check the “Send” button, the highlighted rectangle cannot show the right location, and below is the app screen shot and appium logs.

[Appium] Welcome to Appium v1.6.4
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium]   sessionOverride: true
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session {"capabilities":[{"desiredCapabilities":{"app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100"}},{"requiredCapabilities":{}}],"desiredCapabilities":{"app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100"},"requiredCapabilities":{}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100"},{},[{"desiredCapabilities":{"app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100"}},{"requiredCapabilities":{}}],null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1495008233003 (16:03:53 GMT+0800 (CST))
[Appium] Creating new XCUITestDriver (v2.27.2) session
[Appium] Capabilities:
[Appium]   app: 'com.aia.ipos'
[Appium]   newCommandTimeout: 600
[Appium]   platformVersion: '10.2'
[Appium]   automationName: 'XCUITest'
[Appium]   platformName: 'iOS'
[Appium]   udid: 'f1c6f3362f5996e111a12c30e6e3afca68e37699'
[Appium]   deviceName: 'iPad'
[Appium]   webDriverAgentUrl: 'http://localhost:8100'
[XCUITest] XCUITestDriver version: 2.27.2
[BaseDriver] Session created with session id: 0b4ae8e1-f6b3-4452-a365-040d0486dd86
[XCUITest] Xcode version set to '8.2' (tools v8.1.0.0.1.1476494586)
[XCUITest] iOS SDK Version set to '10.2'
[BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1495008233058 (16:03:53 GMT+0800 (CST))
[XCUITest] Available devices: f1c6f3362f5996e111a12c30e6e3afca68e37699
[XCUITest] Creating iDevice object with udid 'f1c6f3362f5996e111a12c30e6e3afca68e37699'
[XCUITest] Determining device to run tests on: udid: 'f1c6f3362f5996e111a12c30e6e3afca68e37699', real device: true
[XCUITest] App is an iOS bundle, will attempt to run as pre-existing
[BaseDriver] Event 'appConfigured' logged at 1495008233183 (16:03:53 GMT+0800 (CST))
[BaseDriver] Event 'resetStarted' logged at 1495008233183 (16:03:53 GMT+0800 (CST))
[XCUITest] Reset: running ios real device reset flow
[BaseDriver] Event 'resetComplete' logged at 1495008233185 (16:03:53 GMT+0800 (CST))
[iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[BaseDriver] Event 'logCaptureStarted' logged at 1495008233318 (16:03:53 GMT+0800 (CST))
[XCUITest] Setting up real device
[BaseDriver] Event 'wdaStartAttempted' logged at 1495008233324 (16:03:53 GMT+0800 (CST))
[XCUITest] Using WDA path: '/Applications/AppiumNew.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Applications/AppiumNew.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Using provided WebdriverAgent at 'http://localhost:8100'
[BaseDriver] Event 'wdaSessionAttempted' logged at 1495008233329 (16:03:53 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.aia.ipos","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","capabilities":{"device":"ipad","browserName":"iPoS v2.81.r","sdkVersion":"10.2","CFBundleIdentifier":"com.aia.ipos"}},"sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","status":0}
[BaseDriver] Event 'wdaSessionStarted' logged at 1495008235723 (16:03:55 GMT+0800 (CST))
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ayrmqxbiwnspxocbqrmijlxgmktd'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ayrmqxbiwnspxocbqrmijlxgmktd/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-bpghayldhvptlrbmywngovqrglkb'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-bpghayldhvptlrbmywngovqrglkb/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ddxhdyxyniuuwgelrachanejssfs'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ddxhdyxyniuuwgelrachanejssfs/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhlotdontjrpkiafsgctcydbsstc'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-dhlotdontjrpkiafsgctcydbsstc/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ekxsrbaqvkibvideynatpxsrnzrv'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ekxsrbaqvkibvideynatpxsrnzrv/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ggqftcqksoyejqagnqlcqnqqcqyi'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-ggqftcqksoyejqagnqlcqnqqcqyi/Logs/Test/Attachments' folder
[XCUITest] Found WDA derived data folder: '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-gibvfwfknjftygbxxmiscxdhjixl'
[XCUITest] Setting '555' permissions to '/Users/aiait/Library/Developer/Xcode/DerivedData/WebDriverAgent-gibvfwfknjftygbxxmiscxdhjixl/Logs/Test/Attachments' folder
[BaseDriver] Event 'wdaPermsAdjusted' logged at 1495008235737 (16:03:55 GMT+0800 (CST))
[BaseDriver] Event 'wdaStarted' logged at 1495008235738 (16:03:55 GMT+0800 (CST))
[XCUITest] Setting initial orientation to 'PORTRAIT'
[JSONWP Proxy] Proxying [POST /orientation] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/orientation] with body: {"orientation":"PORTRAIT"}
[JSONWP Proxy] Got response with status 200: {"value":"Unable To Rotate Device","sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","status":777}
[XCUITest] Setting initial orientation failed with: UnknownError: An unknown server-side error occurred while processing the command. Original error: Unable To Rotate Device
[BaseDriver] Event 'orientationSet' logged at 1495008241472 (16:04:01 GMT+0800 (CST))
[Appium] New XCUITestDriver session created successfully, session 0b4ae8e1-f6b3-4452-a365-040d0486dd86 added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1495008241475 (16:04:01 GMT+0800 (CST))
[MJSONWP] Responding to client with driver.createSession() result: {"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100"}
[HTTP] <-- POST /wd/hub/session 200 8478 ms - 502 
[HTTP] --> GET /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86 {}
[MJSONWP] Calling AppiumDriver.getSession() with args: ["0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'getSession'
[JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A] with no body
[JSONWP Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"sessionId\" : \"039E3492-A746-4C5A-8B20-F8C715F0532A\",\n    \"capabilities\" : {\n      \"device\" : \"ipad\",\n      \"browserName\" : \"iPoS v2.81.r\",\n      \"sdkVersion\" : \"10.2\",\n      \"CFBundleIdentifier\" : \"com.aia.ipos\"\n    }\n  },\n  \"sessionId\" : \"039E3492-A746-4C5A-8B20-F8C715F0532A\",\n  \"status\" : 0\n}"
[XCUITest] Merging WDA caps over Appium caps for session detail response
[MJSONWP] Responding to client with driver.getSession() result: {"udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100","device":"ipad","browserName":"iPoS v2.81.r","sdkVersion":"10.2","CFBundleIdentifier":"com.aia.ipos"}
[HTTP] <-- GET /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86 200 266 ms - 407 
[HTTP] --> GET /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86 {}
[MJSONWP] Calling AppiumDriver.getSession() with args: ["0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'getSession'
[JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A] with no body
[JSONWP Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"sessionId\" : \"039E3492-A746-4C5A-8B20-F8C715F0532A\",\n    \"capabilities\" : {\n      \"device\" : \"ipad\",\n      \"browserName\" : \"iPoS v2.81.r\",\n      \"sdkVersion\" : \"10.2\",\n      \"CFBundleIdentifier\" : \"com.aia.ipos\"\n    }\n  },\n  \"sessionId\" : \"039E3492-A746-4C5A-8B20-F8C715F0532A\",\n  \"status\" : 0\n}"
[XCUITest] Merging WDA caps over Appium caps for session detail response
[MJSONWP] Responding to client with driver.getSession() result: {"udid":"f1c6f3362f5996e111a12c30e6e3afca68e37699","app":"com.aia.ipos","newCommandTimeout":600,"platformVersion":"10.2","automationName":"XCUITest","platformName":"iOS","deviceName":"iPad","webDriverAgentUrl":"http://localhost:8100","device":"ipad","browserName":"iPoS v2.81.r","sdkVersion":"10.2","CFBundleIdentifier":"com.aia.ipos"}
[HTTP] <-- GET /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86 200 164 ms - 407 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element {"using":"accessibility id","value":"email icon"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["accessibility id","email icon","0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'findElement'
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 0 ms for condition
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element] with body: {"using":"accessibility id","value":"email icon"}
[JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"31F2ECC4-E824-4085-84D8-2E9086E42A1D","type":"XCUIElementTypeButton","label":"email icon"},"sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","status":0}
[MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"31F2ECC4-E824-4085-84D8-2E9086E42A1D","type":"XCUIElementTypeButton","label":"email icon"}
[HTTP] <-- POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element 200 819 ms - 174 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/31F2ECC4-E824-4085-84D8-2E9086E42A1D/click {"id":"31F2ECC4-E824-4085-84D8-2E9086E42A1D"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[XCUITest] Executing command 'proxyReqRes'
[JSONWP Proxy] Proxying [POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/31F2ECC4-E824-4085-84D8-2E9086E42A1D/click] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element/31F2ECC4-E824-4085-84D8-2E9086E42A1D/click] with body: {"id":"31F2ECC4-E824-4085-84D8-2E9086E42A1D"}
[JSONWP Proxy] Got response with status 200: {"status":0,"id":"31F2ECC4-E824-4085-84D8-2E9086E42A1D","value":"","sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A"}
[JSONWP Proxy] Replacing sessionId 039E3492-A746-4C5A-8B20-F8C715F0532A with 0b4ae8e1-f6b3-4452-a365-040d0486dd86
[HTTP] <-- POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/31F2ECC4-E824-4085-84D8-2E9086E42A1D/click 200 1577 ms - 118 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element {"using":"accessibility id","value":"toField"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["accessibility id","toField","0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'findElement'
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 0 ms for condition
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element] with body: {"using":"accessibility id","value":"toField"}
[JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"66E6E76D-2864-410D-9993-B9E4EF1C591E","type":"XCUIElementTypeTextField","label":"To: "},"sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","status":0}
[MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"66E6E76D-2864-410D-9993-B9E4EF1C591E","type":"XCUIElementTypeTextField","label":"To: "}
[HTTP] <-- POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element 200 1135 ms - 171 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/66E6E76D-2864-410D-9993-B9E4EF1C591E/value {"id":"66E6E76D-2864-410D-9993-B9E4EF1C591E","value":["[email protected]"]}
[MJSONWP] Calling AppiumDriver.setValue() with args: [["[email protected]"],"66E6E76D-2864-410D-9993-B9E4EF1C591E","0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'setValue'
[JSONWP Proxy] Proxying [POST /element/66E6E76D-2864-410D-9993-B9E4EF1C591E/value] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element/66E6E76D-2864-410D-9993-B9E4EF1C591E/value] with body: {"value":["x","x","x","@","t","e","s","t",".","c","o","m"]}
[JSONWP Proxy] Got response with status 200: {"status":0,"id":"66E6E76D-2864-410D-9993-B9E4EF1C591E","value":"","sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A"}
[MJSONWP] Responding to client with driver.setValue() result: null
[HTTP] <-- POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/66E6E76D-2864-410D-9993-B9E4EF1C591E/value 200 4651 ms - 76 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element {"using":"accessibility id","value":"Send"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["accessibility id","Send","0b4ae8e1-f6b3-4452-a365-040d0486dd86"]
[XCUITest] Executing command 'findElement'
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 0 ms for condition
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element] with body: {"using":"accessibility id","value":"Send"}
[JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"CA032788-5BF7-490C-ABF4-5ED31EBAFD26","type":"XCUIElementTypeButton","label":"Send"},"sessionId":"039E3492-A746-4C5A-8B20-F8C715F0532A","status":0}
[MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"CA032788-5BF7-490C-ABF4-5ED31EBAFD26","type":"XCUIElementTypeButton","label":"Send"}
[HTTP] <-- POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element 200 1319 ms - 168 
[HTTP] --> POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/CA032788-5BF7-490C-ABF4-5ED31EBAFD26/click {"id":"CA032788-5BF7-490C-ABF4-5ED31EBAFD26"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[XCUITest] Executing command 'proxyReqRes'
[JSONWP Proxy] Proxying [POST /wd/hub/session/0b4ae8e1-f6b3-4452-a365-040d0486dd86/element/CA032788-5BF7-490C-ABF4-5ED31EBAFD26/click] to [POST http://localhost:8100/session/039E3492-A746-4C5A-8B20-F8C715F0532A/element/CA032788-5BF7-490C-ABF4-5ED31EBAFD26/click] with body: {"id":"CA032788-5BF7-490C-ABF4-5ED31EBAFD26"}

very appreciate if any one could give some suggestion/solutions, thanks in advance.

@yangzhengjiang next try:

@iOSXCUITFindBy(iOSNsPredicate = "type == 'XCUIElementTypeButton' AND name == 'Send'")
private IOSElement sendButton;

i have tried your code but still not working, in this page other elements like text field working fine with sendkyes method while only the button no interaction when click or tap, my code as below:

MobileElement e = (MobileElement) driver.findElement(MobileBy
				.AccessibilityId("Send"));
		e.click();

OR

TouchAction action = new TouchAction(driver);
		action.tap(e).perform();

can you share your code how you tired?

my code as below, thanks.

driver.findElement(MobileBy.iOSNsPredicateString(“type == ‘XCUIElementTypeButton’ AND name == ‘Send’”)).click();

@yangzhengjiang you did not specify what happens. Element not found or element found but tap not happen?

if second case check element coordinates where it trying to tap with:

((MobileElement) el).getCenter().getX() + ", " + ((MobileElement) el).getCenter().getY()

my issue is element found but click/tap not happened, following your code still no any interaction when tab the coordinates, my code as below:

MobileElement ex = (MobileElement)driver.findElement(MobileBy.iOSNsPredicateString(“type == ‘XCUIElementTypeButton’ AND name == ‘Send’”));

	int x = ex.getCenter().getX();
	int y = ex.getCenter().getY();
	System.out.println(x + " => " + y);
	TouchAction action = new TouchAction(driver);
	action.tap(x, y).perform();

but are the coordinates looks ok? what values they are?

from my issue enclosed screen dump the “Send” button coordinates is (693,7), however, by this code the output coordinates is (720,22).

your output is center which looks correct. you need more to investigate yourself

@yangzhengjiang I think there is one simple issue! That is orientation!
have you set orientation as landscape in your script? Default value would be portrait!
please add desired capability as named “orientation” and value “LANDSCAPE”
and try your normal findelement and click.
if you still face issue then we will try to send http request directly to device and if needed I will commit fix to facebook/webdriveragent repo.
Appium is using facebook XCUItest webdriveragent and that agent is having issues with Landscape mode! you can see appium desktop screenshot you posted is showing part of keyboard is not present at right hand side and overall screenshot is not perfectly taken by agent!

i have tried your solution and added desired capability as named “orientation” and value as “LANDSCAPE” in my code, but the click “Send” button still not working, as before, only send keys to text filed working well, very appreciate if you could commit this fix to Facebook for further solutions, thanks in advance.

Could you also check if there is another 'Send’Button which is not visible. At times if there are duplicate elements then click on button might not work [Based out of personal experience] as it’s trying for the nonvisible element. Please confirm the same or otherwise let us know the details of the test app so that we can reproduce it from our end that way it would helps us in more detail.

thanks for your suggestion, when i found this issue i was also suspicious if there is existing invisible “Send” button, so i have checked it with code and confirmed only the unique “Send” button in this page.
in previously, the same APP on IOS 9, Appium 1.4.13 and Xcode 7 the “Send” button working well, now our team upgrade our scripts to support IOS 10 automation testing and encountered this wired issue.
if your side want to reproduce this issue just need use a APP that invoke the IOS send email interface will show this page, thanks a lot for your help.

@yangzhengjiang : Actually that behavior is random :slight_smile: [previously working click on "SendButton"]. To be frank I would always check the list of elements returned by textContaining(“MySearchText”) and assure I’ve only one element or more than one element and relevantly take the action call.

Thanks for your confirmation. Happy I was helpful.