We're using TestNG with Selenium, and need to do certain things to setup a browser before a test. In some cases, we want to parallelize based on classes, but we have some tests that have many iterations of data that take a long time, and we would like to parallelize them with methods instead. However it would be ideal if we could setup the test to be able to setup based on a parallel of methods or classes.
The only way I can think of is to setup a @BeforeClass as well as a @BeforeMethod, and do an XmlSuite.getParallel to detect one of the other, but this gets really messy. Is there a better way to say "when starting a new thread, whether its as part of a parallel class or method, setup a new browser window"?
--
Chris