Annotations

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Annotations

====
I have problem understanding what is the difference between @Before/After Test and @Before/After Method annotations. Please help.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Annotations

SUBRAMANYESWARA RAO BHAVIRISETTY
Explanation in one of the previous emails  of the group.

@BeforeMethod is invoked before each method with a @Test annotation.

@BeforeTest is invoked before a <test> tag.

<test>
  <classes>
    <class name="A" />  <-- contains tests a1() and a2()
    <class name="B" />   <-- contains tests b1() and b2()
  </classes>
</test>

In this case, you will see:

@BeforeTest
  @BeforeMethod
    a1()
  @AfterMethod
  @BeforeMethod
    a2()
  @AfterMethod
  @BeforeMethod
    b1()
  @AfterMethod
  @BeforeMethod
    b22()
  @AfterMethod
@AfterTest

Hope this clears things up.


On Thu, Apr 20, 2017 at 11:09 AM, ==== <[hidden email]> wrote:
I have problem understanding what is the difference between @Before/After Test and @Before/After Method annotations. Please help.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.



--
Subramanyam

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Annotations

Hoang Nguyen
In reply to this post by ====
the different is affect scope:

@Before/After Test are affected to tag <test> in xml suite
@Before/After Method are affected to annotation @Test in your class file



Vào 01:09:39 UTC+7 Thứ Sáu, ngày 21 tháng 4 năm 2017, ==== đã viết:
I have problem understanding what is the difference between @Before/After Test and @Before/After Method annotations. Please help.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Loading...