运行 WEBDriver 测试
所以我已经编写 Selenium 测试有一段时间了,并且到目前为止我一直只从 IDE 运行。
我希望能够编写一个脚本来按顺序运行所有测试。 我正在将 testng 框架与 eclipse 和 selenium-2.0b3 jar 一起使用。
我想要的是最终有一个像“runSeleniumTests.bat”这样的文件,女巫只需运行它们并在完成时给我一些报告。
如果有人有想法,我们将非常感激,谢谢:)
So i have been writing Selenium tests for a while now and i have been running the only from the IDE untill now.
i would like to be able to write a script that runs all my tests sequentialy.
I am using the testng framework with eclipse and selenium-2.0b3 jar.
What i'd like is eventually to have a file like "runSeleniumTests.bat" witch just runs them and gives me some sort of report when in finishes.
if anyone has an idea, it will be very greatly appreciated, thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有 4 个选项用于说明如何运行 testng 测试,xml 文件应包含所有测试
http://testng.org/doc/documentation-main.html#running-testng
你也可以尝试使用 maven,只要你的测试注释正确并且在 /src/test/java 中,它们都将使用
mvn Integration-test
为你运行(只要因为您已经定义了正确的依赖关系并且我相信 maven-surefire-plugin)。最初设置可能会比较困难,但通常会得到回报。This has 4 options for how to run testng tests the xml file should include all your tests
http://testng.org/doc/documentation-main.html#running-testng
You could also try to use maven and as long as your tests are annotated correctly and in /src/test/java they will all be run for you with
mvn integration-test
(as long as you have the proper dependencies defined and I believe maven-surefire-plugin). This might be more difficult to setup initially but usually pays off.