Open alyshakt opened 4 years ago
I have the same issue when I try to send keys to an input field
This isn't specific to the Java client. Seeing the same issue on a JavaScript project, also old regression test that has been passing fine for a long time until recently.
Error:
Error: Error Domain=com.facebook.WebDriverAgent Code=1 "'"MnemonicTextView.recoveryPhrase" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus" UserInfo={NSLocalizedDescription='"MnemonicTextView.recoveryPhrase" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus}
Logs:
020-09-04 01:19:09:907 - [HTTP] {"using":"accessibility id","value":"MnemonicTextView.recoveryPhrase"}
2020-09-04 01:19:09:907 - [debug] [MJSONWP (bb9b0596)] Calling AppiumDriver.findElement() with args: ["accessibility id","MnemonicTextView.recoveryPhrase","bb9b0596-b109-4260-af4e-0d41914707e4"]
2020-09-04 01:19:09:908 - [debug] [XCUITest] Executing command 'findElement'
2020-09-04 01:19:09:908 - [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
2020-09-04 01:19:09:908 - [debug] [BaseDriver] Waiting up to 10000 ms for condition
2020-09-04 01:19:09:908 - [debug] [WD Proxy] Matched '/element' to command name 'findElement'
2020-09-04 01:19:09:908 - [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8406/session/C23C8F0E-1445-4252-A20E-474006F29CB6/element] with body: {"using":"accessibility id","value":"MnemonicTextView.recoveryPhrase"}
2020-09-04 01:19:10:032 - [debug] [WD Proxy] Got response with status 200: {"value":{"ELEMENT":"21000000-0000-0000-BF10-000000000000","element-6066-11e4-a52e-4f735466cecf":"21000000-0000-0000-BF10-000000000000"},"sessionId":"C23C8F0E-1445-4252-A20E-474006F29CB6"}
2020-09-04 01:19:10:032 - [debug] [MJSONWP (bb9b0596)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"21000000-0000-0000-BF10-000000000000","ELEMENT":"21000000-0000-0000-BF10-000000000000"}
2020-09-04 01:19:10:032 - [HTTP] <-- POST /wd/hub/session/bb9b0596-b109-4260-af4e-0d41914707e4/element 200 125 ms - 199
2020-09-04 01:19:10:032 - [HTTP]
2020-09-04 01:19:10:127 - [HTTP] --> POST /wd/hub/session/bb9b0596-b109-4260-af4e-0d41914707e4/touch/perform
2020-09-04 01:19:10:127 - [HTTP] {"actions":[{"action":"tap","options":{"element":"21000000-0000-0000-BF10-000000000000"}}]}
2020-09-04 01:19:10:128 - [debug] [MJSONWP (bb9b0596)] Calling AppiumDriver.performTouch() with args: [[{"action":"tap","options":{"element":"21000000-0000-0000-BF10-000000000000"}}],"bb9b0596-b109-4260-af4e-0d41914707e4"]
2020-09-04 01:19:10:128 - [debug] [XCUITest] Executing command 'performTouch'
2020-09-04 01:19:10:128 - [debug] [XCUITest] Received the following touch action: tap(options={"element":"21000000-0000-0000-BF10-000000000000"})
2020-09-04 01:19:10:140 - [debug] [WD Proxy] Proxying [POST /wda/touch/perform] to [POST http://127.0.0.1:8406/session/C23C8F0E-1445-4252-A20E-474006F29CB6/wda/touch/perform] with body: {"actions":[{"action":"tap","options":{"element":"21000000-0000-0000-BF10-000000000000"}}]}
2020-09-04 01:19:10:397 - [debug] [WD Proxy] Got response with status 200: {"value":null,"sessionId":"C23C8F0E-1445-4252-A20E-474006F29CB6"}
2020-09-04 01:19:10:397 - [debug] [MJSONWP (bb9b0596)] Responding to client with driver.performTouch() result: null
2020-09-04 01:19:10:398 - [HTTP] <-- POST /wd/hub/session/bb9b0596-b109-4260-af4e-0d41914707e4/touch/perform 200 270 ms - 76
2020-09-04 01:19:10:398 - [HTTP]
2020-09-04 01:19:10:472 - [HTTP] --> POST /wd/hub/session/bb9b0596-b109-4260-af4e-0d41914707e4/element/21000000-0000-0000-BF10-000000000000/value
2020-09-04 01:19:10:472 - [HTTP] {"text":"hold panel make absent soccer quick pink brand race tortoise verify nature"}
2020-09-04 01:19:10:473 - [debug] [MJSONWP (bb9b0596)] Calling AppiumDriver.setValue() with args: ["hold panel make absent soccer quick pink brand race tortoise verify nature","21000000-0000-0000-BF10-000000000000","bb9b0596-b109-4260-af4e-0d41914707e4"]
2020-09-04 01:19:10:473 - [debug] [XCUITest] Executing command 'setValue'
2020-09-04 01:19:10:474 - [debug] [WD Proxy] Matched '/element/21000000-0000-0000-BF10-000000000000/value' to command name 'setValue'
2020-09-04 01:19:10:474 - [debug] [Protocol Converter] Added 'text' property "hold panel make absent soccer quick pink brand race tortoise verify nature" to 'setValue' request body
2020-09-04 01:19:10:474 - [debug] [WD Proxy] Proxying [POST /element/21000000-0000-0000-BF10-000000000000/value] to [POST http://127.0.0.1:8406/session/C23C8F0E-1445-4252-A20E-474006F29CB6/element/21000000-0000-0000-BF10-000000000000/value] with body: {"value":["h","o","l","d"," ","p","a","n","e","l"," ","m","a","k","e"," ","a","b","s","e","n","t"," ","s","o","c","c","e","r"," ","q","u","i","c","k"," ","p","i","n","k"," ","b","r","a","n","d"," ","r","a","c","e"," ","t","o","r","t","o","i","s","e"," ","v","e","r","i","f","y"," ","n","a","t","u","r","e"],"text":"hold panel make absent soccer quick pink brand race tortoise verify nature"}
2020-09-04 01:19:11:874 - [WD Proxy] Got response with status 400: {"value":{"error":"invalid element state","message":"Error Domain=com.facebook.WebDriverAgent Code=1 \"'\"MnemonicTextView.recoveryPhrase\" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus\" UserInfo={NSLocalizedDescription='\"MnemonicTextView.recoveryPhrase\" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus}","traceback":""},"sessionId":"C23C8F0E-1445-4252-A20E-474006F29CB6"}
2020-09-04 01:19:11:875 - [debug] [W3C] Matched W3C error code 'invalid element state' to InvalidElementStateError
2020-09-04 01:19:11:903 - [debug] [MJSONWP (bb9b0596)] Encountered internal error running command: InvalidElementStateError: Error Domain=com.facebook.WebDriverAgent Code=1 "'"MnemonicTextView.recoveryPhrase" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus" UserInfo={NSLocalizedDescription='"MnemonicTextView.recoveryPhrase" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus}
2020-09-04 01:19:11:903 - [debug] [MJSONWP (bb9b0596)] at errorFromW3CJsonCode (/usr/local/.browserstack/appium_1.18.0_bstack/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
2020-09-04 01:19:11:904 - [debug] [MJSONWP (bb9b0596)] at ProxyRequestError.getActualError (/usr/local/.browserstack/appium_1.18.0_bstack/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
2020-09-04 01:19:11:904 - [debug] [MJSONWP (bb9b0596)] at JWProxy.command (/usr/local/.browserstack/appium_1.18.0_bstack/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:279:8)
2020-09-04 01:19:11:904 - [debug] [MJSONWP (bb9b0596)] at process._tickCallback (internal/process/next_tick.js:68:7)
2020-09-04 01:19:11:904 - [HTTP] <-- POST /wd/hub/session/bb9b0596-b109-4260-af4e-0d41914707e4/element/21000000-0000-0000-BF10-000000000000/value 500 1432 ms - 508
Downgrading to Appium 1.17.0 has resolved the issue for me. Can we move this issue over to the main repo? @mykola-mokhnach
@GeorgeXCV Please attach the page source output. It could be the page has multiple elements with duplicated identifiers
@mykola-mokhnach The iOS page that had this issue has two elements only, text input and a button. Like the OP, the regression test and actual UI hasn't changed in months. Downgrading to Appium 1.17.0 worked for me.
Sorry, I cannot help nothing without the details. Also, you won't be able to use older Appium versions while Apple does new iOS releases.
What details? I have never heard of page source output in the context of an iOS Application. Logs show one element is found. Downgrading is what fixed the issue, I believe its a bug with Appium.
Having same issue:
Page Source including"mobile: source" - 20200906084105_872.txt
Appium Log - appiumServeriPhone8.log
@NirBY Try W3C actions to send text as a possible workaround. You could also replace local WDA source with https://github.com/appium/WebDriverAgent/pull/379. I have disabled focus check there, so it makes sense to check if that helps.
appium/WebDriverAgent#379 This works. I have tested with my test app and I am able to type to StaticTextField which was working fine with 1.17.1 and stopped when updated to 1.18.1
@mykola-mokhnach - Thanks for the quick fix.
@mykola-mokhnach used WebDriverAgent 11.7 since I have xcode 11.7 (I have just replaced all files in /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent). It didnt worked, Appium log - appiumServeriPhone8.log.txt
Note:
Thank you @mykola-mokhnach. W3C actions worked for me. while waiting for the release of the new WebDriverAgent.
Description
Just recently unable to enter text into a XCUIElementTypeSecureTextField on iOS as I consistently get
InvalidElementStateException: Error Domain=com.facebook.WebDriverAgent Code=1 "'"passwordTextField" SecureTextField' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus
I have already tried different identifiers such as xpath vs className, name, everything. I have already tried setting hardware keyboard to true and/or false. I have already tried setting different sendKeyStrategy options. I have already tried getKeyboard() before and after interacting with the field.
This is a sudden break on very old regression tests, without changes to source test code or source app code for context.
Steps:
Environment
``
Details
Please provide more details, if necessary.
Code To Reproduce Issue [ Good To Have ]
@FindBy(name = "passwordTextField") private WebElement passwordTextField;
public void enterFirstPassword(String password){ ((IOSDriver)driver).getKeyboard(); passwordTextField.clear(); passwordTextField.sendKeys(password); ((IOSDriver)driver).hideKeyboard(HideKeyboardStrategy.PRESS_KEY,"next"); }
Exception Stacktraces
Link To Appium Logs
https://gist.github.com/alyshakt/365996aac3dd47ee38feded21c512070