问题
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