Annotations @BeforeGroups problem

21 views
Skip to first unread message

fakelololo fakelololo

unread,
Apr 23, 2021, 8:55:04 AM4/23/21
to testng-users
Hi, 

I have some problem with @BeforeGroups and @AfterGroups annotations. 
I try to run this example code 
@BeforeGroups(groups = "test")
public void before() {
System.out.println("before");
}

@AfterGroups(groups = "test")
public void after() {
System.out.println("after");
}

@Test()
public void test() {
System.out.println("test");
}

@Test(groups = {"test"})
public void test1() {
System.out.println("test1");
}

and I expect output values in order
test
before
test1
after

but from version 7.1.0 and above result is
test
test1

Do I need some additional configuration to use @BeforeGroup annotation or it's bug?

Regards,
Bartek

⇜Krishnan Mahadevan⇝

unread,
Apr 25, 2021, 11:36:59 AM4/25/21
to testng-users
BeforeGroups will be executed only when you are running your tests with groups. 
Can you please check this ?


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
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 testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/279e853c-18a6-47d8-954a-d03da6829b87n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages