无法在 Junit Selenium 测试中调用 autoit 可执行文件

发布于 2024-12-06 06:28:24 字数 1106 浏览 0 评论 0原文

我希望每个人都度过了美好的一天,并且感谢任何和所有的帮助。

我正在 Internet Explorer 7 中运行自动 Selenium Junit4(远程控制)测试。为此,我使用了以下教程:http://qtp-help.blogspot.com/2009/07/selenium-handle-dialogs.html

该测试是从我的 mac 上的 springsource ide 运行的,并通过我的虚拟框( windows xp sp 3 )到 Internet Explorer 7 执行。运行测试时,请明确按照教程中的说明进行操作,当它到达标有星号的步骤:

Thread.sleep(2000);
    String browser = selenium.getEval("navigator.userAgent");
    if(browser.contains("IE")){
        System.out.print("Browser= IE "+browser);
    *   String[] dialog = new String[]{ "Save_Dialog_IE.exe","Download","Save" };
        Runtime.getRuntime().exec(dialog);

我收到错误:找不到文件或目录

如果我在命令提示符中手动调用 Save_Dialog_IE.exe,该进程将运行并与互动IE7浏览器对话框成功。但是当尝试在执行硒测试时调用它时,它不会。

本教程中我不确定是否正确执行的唯一步骤是将可执行文件(Save_Dialog_IE.exe 放在项目目录中)。我不确定该文件在项目中的确切位置。我将其放置在项目的根目录以及项目中为 junit 测试创建类的文件夹中。对于它到底需要去哪里有点模糊。

有人对如何使这项工作有任何想法吗?或者甚至有关于如何与在 mac 上运行 selenium 测试的 IE7 浏览器对话框交互到运行 windows xp sp3 的虚拟 VMware 盒子的想法?

I hope everyone is having a most excellent day and any and all help is appreciated.

I am running an automated Selenium Junit4(remote control) test in internet explorer 7. To do this I utilized the following tutorial: http://qtp-help.blogspot.com/2009/07/selenium-handle-dialogs.html.

The test is being run from my springsource ide on my mac and is being executed through my virtual box ( windows xp sp 3 ) to internet explorer 7. When the test is run, following the directions in the tutorial explicitly, when it gets to the step that is marked with an asterisk:

Thread.sleep(2000);
    String browser = selenium.getEval("navigator.userAgent");
    if(browser.contains("IE")){
        System.out.print("Browser= IE "+browser);
    *   String[] dialog = new String[]{ "Save_Dialog_IE.exe","Download","Save" };
        Runtime.getRuntime().exec(dialog);

I get the error: can not find file or directory

If I call the Save_Dialog_IE.exe inside of a command prompt manually the process runs and interaction with the IE7 browser dialogs are successful. But when attempting to call it while executing the selenium test it does not.

The only step in the tutorial I am not sure I did correctly was placing the executable (Save_Dialog_IE.exe in the project directory). I am not sure exactly where in the project to place the file. I placed it in both the root directory of the project as well as the folder in the project where I created the class for the junit test. A little fuzzy as to exactly where it needs to go.

Anybody got any ideas how to make this work? Or even any idea's as to how to interact with IE7 browser dialogs running a selenium test on a mac to a virtual VMware box running windows xp sp3?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海夕 2024-12-13 06:28:24

.exe 文件需要与程序所在的目录(运行其自己的 .exe)位于同一目录中。我不确定它如何与 selenium 一起使用,但您可能只需要执行以下操作:

1).exe 文件需要位于项目的根目录中。然后您必须获取其属性,并确保 .exe 已复制到项目输出中。通常这是 /bin/Debug/ (或 /Release/)文件夹,但我不确定它如何与 selenium 一起使用。

或者 2) 将 .exe 文件与您的 selenium 测试应用程序放在一起,无论它在哪里。

The .exe file needs to be in the same directory as from where your program (its own .exe is run). I'm not sure how it works with selenium, but you may just need to do:

1) The .exe file needs to go in the root of your project. Then you have to get its properties, and make sure that the .exe is copied to the project output. Usually this is the /bin/Debug/ (or /Release/) folder, but I'm not sure how that works with selenium.

Or 2) Put the .exe file along with your selenium test application, wherever that is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文