how to run two selenium java files on after the other continuously when they dont have any relation in between them

人盡茶涼 提交于 2019-12-12 02:57:58

问题


I have a web application for which I have done automation tests in Selenium using TESTNG on admin module and user module. Now I need to run the java files continuously one after the other(1st admin then the user module). No methods are common between them. I just want to run the user module java file as soon as the admin module has finished running.


回答1:


You can use dependsOn attribute of TestNG if one test is dependent on pass/fail of previous one OR you can use groups attribute. Refer TestNG site, they have good examples.




回答2:


Using Testing framework is preferable, still if you are not interested, you can create a standalone class, from the main method, call your test class's main method one by one as per your requirement. Simple :)



来源:https://stackoverflow.com/questions/17369629/how-to-run-two-selenium-java-files-on-after-the-other-continuously-when-they-don

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!