I have a couple WebView actions in the native app I’m tested that don’t behave very well with sendKeys or setValue. However, if I slow down the input with a loop and only enter 1-2 characters at a time it “works”. The workaround in Android to do this is to loop through and call “setValue”. sendKeys clears the field, keyboardSendKeys looks like the WebDriver selects the element, with a long press or something therefore selecting the text already sent.
So I’m looking for a one-stop (or even a “script” or something) in the Java client to say send “abcdefghi” one key at a time without clicking in the element every time (which setValue does, slowing the already slow input down), or to have a “delay” option with sendKeys to slow it down in some instances.
Java Client 5.0.0-BETA9
Appium Server 1.6.6-beta.4
// Tried these, but they all do the same thing of
// POST /wd/hub/session/30bd4df9-9fa1-40f3-973e-65b76ad9cda6/keys {"value":["ti"]}
//
// appiumDriver.getKeyboard().sendKeys(characters);
// element.execute(DriverCommand.SEND_KEYS_TO_ACTIVE_ELEMENT, ImmutableMap.of("value", characters));
// This doesn't work, it tries:
// POST /wd/hub/session/4c18f1d5-916f-4b11-a2a1-605587559dfa/element/9/value {"id":"9","value":["il"]}
// element.sendKeys(characters);
// This one works for some reason, but does click (or tap) in the middle of the element first (so a long string won't work)
// POST /wd/hub/session/53307101-405d-4f80-828b-7c6d57a52b90/appium/element/9/value {"id":"9","value":"to"}
element.setValue(characters);
Thanks,
Ben