'Unable to pass values using SendKeys() while automating desktop application using WinAppDriver
Need your help on a point where I got stuck on automating desktop application. I am unable to send values to input field of desktop application. Say for example, in Notepad, we have 'Find Next' pop up. I couldn't send values to the Find Next: input field using sendKeys method. I am able to send values to the text editor of notepad though. I am trying to find a solution using SendKeys method. I appreciate any help here! Thanks!
Below is the code----
capabilities.setCapability("app", "C:\\Windows\\System32\\notepad.exe");
capabilities.setCapability("platformName","Windows");
capabilities.setCapability("deviceName", "WindowsPC");
notepadSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities);
notepadSession.findElement(By.name("Text Editor")).sendKeys("Hi there!");
Robot r= new Robot();
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_F);
r.keyRelease(KeyEvent.VK_CONTROL);
r.keyRelease(KeyEvent.VK_F);
notepadSession.findElement(By.name("Find")).findElement("Find what:")).sendKeys("Hi");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
