Can TestNG run multiple suites?
-
my problem is as follows: I am testing a web-ui using Selenium and TestNG. I have a test suite with many test classes in it. I have a @BeforeSuite method which also has a @Parameters annotation, this method receives as a parameter the browser in which the Selenium test will be run, executing the lines: selenium = new DefaultSelenium("localhost", 4444, browser, "http://localhost:8099"); selenium.start(); The XML I'm using to run the test suite is: <suite name="suite"> <parameter name = "browser" value = "*firefox"/> <test name="allTests"> <classes> <class name="test.webui.MemcachedDeploymentTest" /> </classes> </test> </suite> This works fine and the test runs in Firefox. my problem is that i would like to somehow run this suite again, immediately after the first run finishes, but this time with Chrome as the browser. i now have 2 XML suites, one with Chrome and one with Firefox. Is there any way to run these test suites one after the other automatically? maybe using a third XML?
-
Answer:
Put your parameter tag inside the test tag and create another test tag: <suite name="suite"> <test name="Firefox tests"> <parameter name = "browser" value = "*firefox"/> <classes> <class name="test.webui.MemcachedDeploymentTest" /> </classes> </test> <test name="Chrome tests"> <parameter name = "browser" value = "*chrome"/> <classes> <class name="test.webui.MemcachedDeploymentTest" /> </classes> </test> </suite> Another option that would be less verbose would be to use @Factory.
Eli at Stack Overflow Visit the source
Related Q & A:
- How can Linux run on different microprocessors?Best solution by Server Fault
- How can I run all my selenium tests sequentially in C#?Best solution by Stack Overflow
- How many rake tasks can be run at once in rails?Best solution by stackoverflow.com
- How can I run CMD command?Best solution by Super User
- How can I send multiple Yahoo E mails?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.