WebDriver click on “Java window”

2019-09-07 08:53发布

问题:

I'm saving files from the Application, and have this save window:



Here to press "OK" button I used next method:

Robot robot = new Robot();
    robot.keyPress(KeyEvent.VK_ENTER);
    robot.keyRelease(KeyEvent.VK_ENTER);

After this window Java Loading application to open it:

And After this I have this window and previous code doesn't work here, I can't press Enter: Who know how to Click on "Run" on the last screenshot?

回答1:

I think again it will be a lot easier to use Sikuli for the job. You can do it with the simplest hello world example- http://doc.sikuli.org/tutorials/helloworld/helloworld-win.html