Keypress events with selenium webdriver

Hi,

I am new in Appium and currently i am working on Android app automation using Appium.

I have a text field with default values ,000 in it. i want to type some value such as 200,000 in the text box, but once ‘200’ is entered in Textbox,From Keypad, ‘Space’ button is pressed instead of ‘Done’ button.

If anyone please help me to solve this.Tried so many options but still it is not working.Attached screenshot for more detail ‘Textbox.png’

Here is my script code.

       driver.findElement(By.id("com.peddle.seller:id/mileageInputPreText")).sendKeys("200");
    WebElement Next = driver.findElement(By.name("Next")); 
    Next.click();

Thanks,
Gunjan

Hi Gunjan,

here is the solution, this is ruby code . In java you can use driver.keyevent(66) for done. I think there aren’t any Key code for “Done”, to achieve this please try sending enter’s key code (which is 66).

Thanks,
Donald

1 Like

Hey,

Thanks, It is working.Thanks again.