处理 windows IE11 中的保存对话框
To handle windows save dialog box in IE11
有人可以帮助我使用自动 IT 在 selenium 中处理 windows 对话框。
我想按保存。在 AutoIt 脚本中使用 Send('!s')
并在我的程序中使用 Runtime.getRuntime().exec("C:\Selenium\FileDownload.exe")
调用。
这保存了文档,但在该程序出错之后。
也用过机器人 class 但它对我不起作用。
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_S);
谢谢
如果脚本 运行 在独立 运行 时完全正常,请使用以下代码调用您的 AutoIT 脚本。
字符串 strModalDialogExeName = "C:\Selenium\FileUpload.exe";
进程 p = Runtime.getRuntime().exec(strModalDialogExeName); p.waitFor();<br>
int intExitCode = p.exitValue();<br>
System.out.println(intExitCode);
p.destroy();
有人可以帮助我使用自动 IT 在 selenium 中处理 windows 对话框。
我想按保存。在 AutoIt 脚本中使用 Send('!s')
并在我的程序中使用 Runtime.getRuntime().exec("C:\Selenium\FileDownload.exe")
调用。
这保存了文档,但在该程序出错之后。
也用过机器人 class 但它对我不起作用。
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_S);
谢谢
如果脚本 运行 在独立 运行 时完全正常,请使用以下代码调用您的 AutoIT 脚本。
字符串 strModalDialogExeName = "C:\Selenium\FileUpload.exe";
进程 p = Runtime.getRuntime().exec(strModalDialogExeName); p.waitFor();<br>
int intExitCode = p.exitValue();<br>
System.out.println(intExitCode);
p.destroy();