0

我正在使用 selenium 2.0 作为框架修复自动化代码的一些错误。我安装了 ant,并在 windows 07 64 位上使用 Eclipse Juno。在对代码进行任何更改之前,我在命令提示符和 eclipse 上运行脚本没有任何问题。但是,由于我做了一些更改,脚本只在 Eclipse 上运行,不再在命令提示符下运行。我试图找出问题,但没有想出答案。这是对正在发生的事情的描述:当我输入命令提示符“ant init”时,我得到以下信息:

init
BUILD SUCCESSFUL
总时间:0 秒

但是,当我键入命令行“ ant run-ondemand -Dtype=package -Dpackage.name=comMy_package.Test”时,我得到以下内容:

BUILD FAILED
目标“run-ondemand”在项目“my_Project”中不存在
总时间:0 秒。

我是 Selenium 和 Ant 的新手。有人有什么主意吗?谢谢你的时间。

4

1 回答 1

0

I guess I figured out the solution. Eclipse changes the build.xml file every time i run the script after some changes are made on the source. The new settings generated on the build.xml file is now different from the one that was initially recognized by Ant. to avoid the problem, I just copied the original settings of the build.xml file and pasted it in the one containing the current settings. I then run the script via the command prompt and everything just works fine now. If I want to run the script with Eclipse, I will paste the settings generated by eclipse earlier, as i saved it in a text file.

于 2013-07-26T22:19:07.277 回答