【问题标题】:To handle windows save dialog box in IE11在 IE11 中处理 windows 保存对话框
【发布时间】:2016-12-21 09:54:08
【问题描述】:

有人可以帮助我使用 auto IT 在 selenium 中处理 windows 对话框。 我想按保存。在 AutoIt 脚本中使用了Send('!s'),并使用Runtime.getRuntime().exec("C:\\Selenium\\FileDownload.exe") 在我的程序中调用。 这会保存文档,但在该程序出错之后。 也使用过机器人类,但它对我不起作用。

    Robot robot=new Robot();
    robot.keyPress(KeyEvent.VK_ALT);
    robot.keyPress(KeyEvent.VK_S);
    robot.keyRelease(KeyEvent.VK_ALT);
    robot.keyRelease(KeyEvent.VK_S);

谢谢

【问题讨论】:

    标签: selenium autoit


    【解决方案1】:

    如果脚本在独立运行时运行良好,请使用以下代码调用您的 AutoIT 脚本。 String strModalDialogExeName = "C:\\Selenium\\FileUpload.exe"; Process p = Runtime.getRuntime().exec(strModalDialogExeName); p.waitFor();
    int intExitCode = p.exitValue();
    System.out.println(intExitCode); p.destroy();

    【讨论】:

      猜你喜欢
      • 2016-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多