Hello,
Test1.java
Public class Test1 extends BaseTest(){
….
}
Test2.java
Public class Test2 extends BaseTest(){
….
}
ClassA.java
Public class ClassA(){
@BeforeSuite
Public void beforeSuite(){
System.out.println(“before suite”);
}
@BeforeMethod
Public void beforeMethod(){
System.out.println(“before method”);
}
}
If I run test1 and test2 (testng tests), BeforeSuite and BeforeMethod annotations do not get invoked as expected.
One way I could fix it is by including these annotations in BaseTest.java but I do not want to include these two annotations in BaseTest.
In BaseTest.java, is there a way I can invoke BeforeSuite and BeforeMethod annotations without extending ClassA? I am not a java expert. I assume I need to add some code in BaseTest and ClassA files? Please let me know if you have any suggestions.
In BaseTest.java, is there a way I can invoke BeforeSuite and BeforeMethod annotations without extending ClassA? I am not a java expert. I assume I need to add some code in BaseTest and ClassA files? Please let me know if you have any suggestions.
--
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/1388e5c8-9cc8-43f6-9879-54af6c613961n%40googlegroups.com.