Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Method dependency issues
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lidia  
View profile  
 More options Nov 6, 9:35 pm
From: Lidia <lid...@gmail.com>
Date: Fri, 6 Nov 2009 18:35:40 -0800 (PST)
Local: Fri, Nov 6 2009 9:35 pm
Subject: Method dependency issues
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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cédric Beust ♔  
View profile  
 More options Nov 6, 11:04 pm
From: Cédric Beust ♔ <cbe...@google.com>
Date: Fri, 6 Nov 2009 20:04:38 -0800
Local: Fri, Nov 6 2009 11:04 pm
Subject: Re: [testng-users] Method dependency issues

Hi Lidia,

You should not be mixing @Test with @AfterSuite, you should break down this
code in two categories (which one is really a test and which one is used to
tear down your test) and put these in separate methods.

Can you do this and post your updated code if you're still having problems?

--
Cedric

--
***Cédric
*

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lidia  
View profile  
 More options Nov 10, 5:58 pm
From: Lidia <lid...@gmail.com>
Date: Tue, 10 Nov 2009 14:58:58 -0800 (PST)
Local: Tues, Nov 10 2009 5:58 pm
Subject: Re: Method dependency issues
After removing @Test annotation for setUp and dependency of tests on
setUp, it all works fine.

Thanks!
Lidia

On Nov 6, 8:04 pm, Cédric Beust ♔ <cbe...@google.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cédric Beust ♔  
View profile  
 More options Nov 10, 6:02 pm
From: Cédric Beust ♔ <cbe...@google.com>
Date: Tue, 10 Nov 2009 15:02:03 -0800
Local: Tues, Nov 10 2009 6:02 pm
Subject: Re: [testng-users] Re: Method dependency issues

On Tue, Nov 10, 2009 at 2:58 PM, Lidia <lid...@gmail.com> wrote:

> After removing @Test annotation for setUp and dependency of tests on
> setUp, it all works fine.

Glad to hear it!

--
***Cédric
*


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google