Winium Automation- How to press Enter or Escape on keyboard using Winium with java?

3k Views Asked by At

I tried all of these but it's still not working

  driver.findElementByName("3").sendKeys(Keys.ENTER);
  driver.findElementByName("Form1").sendKeys(Keys.ENTER);
  driver.findElement(By.name("3")).sendKeys(Keys.ESCAPE);
  driver.findElement(By.name("3")).sendKeys(Keys.ENTER);

Though, clicking works. Here's the command that I use. driver.findElement(By.name("3")).click();

Thanks in Advance.

2

There are 2 best solutions below

0
On

I already make if worked by using this command.

 driver.findElement(By.name("3")).submit();
0
On

You can make it as follows

driver.findElement(By.name("3")).sendKeys("{ESCAPE}");
driver.findElement(By.name("3")).sendKeys("{ENTER}");