Populate two different email ids without clearing existing emailid in the text box

Hi,

@Aleksei

I want to populate two diff email id in a single To field area in iOS Appium.

Below steps are tried to send two email ids:

  1. clicked on To field text area
  2. using setvalue - populated emailid 1.
  3. tapped on return button in keypad.
  4. using set value - populated email id 2 - but it cleared the previously entered email id 1 and populated email id 2.

My goal is to populate two email ids without clearing off.

Thanks in advance

sendkeys ->

new Actions(driver).sendKeys(text).perform();

= it will add text to whatever previous in input field

Hi,

I used below code snippet to send multiple email id in a for loop and got below err.

         driver.findElement(MobileBy.iOSClassChain(classChain)).click();
         new Actions(driver).sendKeys(value).perform();

Proxying [POST /actions] to [POST http://127.0.0.1:8100/session/CF15DC14-F54E-4337-A09F-7CDD4A7A722E/actions] with body: {“actions”:[{“type”:“key”,“actions”:[{“type”:“keyDown”,“value”:“t”},{“type”:“keyUp”,“value”:“t”},{“type”:“keyDown”,“value”:“e”},{“type”:“keyUp”,“value”:“e”},{“type”:“keyDown”,“value”:“s”},{“type”:“keyUp”,“value”:“s”},{“type”:“keyDown”,“value”:“t”},{“type”:“keyUp”,“value”:“t”},{“type”:“keyDown”,“value”:“1”},{“type”:“keyUp”,“value”:“1”},{“type”:“keyDown”,“value”:“2”},{“type”:“keyUp”,“value”:“2”},{“type”:“keyDown”,“value”:“3”},{“type”:“keyUp”,“value”:“3”},{“type”:“keyDown”,“value”:“x”},{“type”:“keyUp”,“value”:“x”},{“type”:“keyDown”,“value”:“c”},{“type”:“keyUp”,“value”:“c”},{“type”:“keyDown”,“value”:“a”},{“type”:“keyUp”,“value”:“a”}],“id”:“default keyboard”}]}
e[35m[WD Proxy]e[39m Got response with status 500: {“value”:{“error”:“unknown error”,“message”:“Error Domain=com.facebook.WebDriverAgent Code=1 “Only actions of ‘pointer’ type are supported. ‘key’ is given instead for action with id ‘default keyboard’” UserInfo={NSLocalizedDescription=Only actions of ‘pointer’ type are supported. ‘key’ is given instead for action with id ‘default keyboard’}”,“traceback”:""},“sessionId”:“CF15DC14-F54E-4337-A09F-7CDD4A7A722E”}
[debug] e[35m[W3C]e[39m Matched W3C error code ‘unknown error’ to UnknownError
[debug] e[35m[W3C (cd8f8b1d)]e[39m Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 “Only actions of ‘pointer’ type are supported. ‘key’ is given instead for action with id ‘default keyboard’” UserInfo={NSLocalizedDescription=Only actions of ‘pointer’ type are supported. ‘key’ is given instead for action with id ‘default keyboard’}
[debug] e[35m[W3C (cd8f8b1d)]e[39m at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
[debug] e[35m[W3C (cd8f8b1d)]e[39m at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
[debug] e[35m[W3C (cd8f8b1d)]e[39m at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:264:19)
e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session/cd8f8b1d-f193-49cf-94b1-ec452907f363/actions e[39me[31m500e[39m e[90m49 ms - 1238e[39m
e[35m[HTTP]e[39m e[90me[39m

Let me know if I need to change anything else in the snippet.

hi.

  1. does keyboard appear after tap?
  2. add
driver.switchTo().activeElement();

after click and before sendKeys. see -> https://github.com/appium/appium/issues/11389
3) try also “driver.getKeyboard().sendKeys(“text”);”

  1. Yes, after tap keypad appears.

I have doubt on, When should I switch the driver to active element? is it after tap or before tap on text area?

below is the used code snippet:
driver.findElement(MobileBy.iOSClassChain(classChain)).click();
driver.switchTo().activeElement();
new Actions(driver).sendKeys(value).perform();

 - After tap, value is not sent on the text area. we haven’t passed the classchain to the action-sendkeys function. Due to that, isn’t populated the text?

Thanks in advance.

Keyboard actions for iOS are only supported in recent server releases

yes. what is your appium version? hope at least 1.18+