Lidia
unread,Nov 6, 2009, 9:35:40 PM11/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to testng-users
Hello
I have some basic questions related to method dependency. I have the
following test:
@Test (groups = {"jsf", "ajax", "crossbrowser"})
public class TestCrossbrowserUpdateAttr extends SeleneseTestCase {
(...)
@BeforeSuite(alwaysRun = true)
@Test
public void setUp(){
(start selenium here, open start page, etc)
}
@Test (dependsOnMethods = {"setUp"})
public void test1() throws Exception {
(test logic)
}
@Test (dependsOnMethods = {"test1"},
alwaysRun = true)
public void test2() throws Exception{
(test logic)
}
@AfterSuite(alwaysRun = true)
@Test (dependsOnMethods = {"test2"})
public void stopTest() {
(stop selenium, closes browser windows, etc)
}
The problem with this design is that when test2 fails, stopTest is
skipped. I thought that with alwaysRun=true this method would always
get called. How can I assure that it is always called?
I have another test class, where I have about 8 tests that are
independent of each other, and thus I made all of them dependent only
on setUp(). However, I am not certain how I can tie in the stopTest()
method. It does not depend on any other method in particular but
needs to be executed once all the test methods complete. What's the
correct approach here?
Thanks
Lidia