How to type my name inside the edit field, if the native keypad used in the application

Hi,

I have used code as,

	WebElement setname=driver.findElement(By.id("com.abc.xyz:id/alias_name"));
	setname.sendKeys("appiumtest");

But, when i run the testscript, edit field doesn’t fill with “appiumtest”

please help.

BR,
Sagar Varpe

Android keycodes do not directly map to ASCII characters. You can look up the keycodes here: http://developer.android.com/reference/android/view/KeyEvent.html

You can write a front end to sendKeys which translates a string into an array of keycodes and sends them individually.

Can you please share the Appium logs?

Alternatively, we use the type method on Text objects to send strings.

I am using sendKeys and it is working fine for me. I tried with 1.3.4 and 1.4 Appium server with Java on Windows (Android)

Great. @saggy29, follow @Umar_Khan’s suggestions for debugging the problem.

Hi @willosser, Thanks for your help.
I have used the code as,
WebElement setname=driver.findElement(By.id(“com.abc.xyz:id/alias_name”));
setname.sendKeys(“KEYCODE_BUTTON_A”);
OR
WebElement setname=driver.findElement(By.id(“com.abc.xyz:id/alias_name”));
setname.sendKeys(“KEYCODE_A”);

But both the statement do not work, can you please provide the code here.

BR,
Sagar Varpe

element might be under webview.
U need to change the context from native to webview
for more info on webview u can read threads in forum related to webview