Integrating junit annotations with testng tests

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Integrating junit annotations with testng tests

reachout
I am trying to integrate junit annotations like @RunWith and few others to be run as part of testng test

@RunWith(XXX.class)  -> junit
public class BaseTestClass {
  
  protected static YYY yy= null;
  protected static zzzz zz = null;
  @BeforeBrowserSession ->junit
  
  starts browser

  }
  

@Test(testname = "test1", dataprovider= "getData"
{
 system.out.println(hello);

}


When I run the test it does not run the junit annotations which is used for starting the browsers, rather just prints the hello. Any help is appreciate. 

--
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
|

Re: Integrating junit annotations with testng tests

Julien Herr
TestNG supports the run of JUnit tests but doesn't support JUnit annotations in TestNG tests. You will have to choice between JUnit or TestNG.

I don't know which framework is using the @BeforeBrowserSession annotation but you may ask its maintainers to add support of TestNG too.

Le lundi 30 janvier 2017 18:49:46 UTC+1, reachout a écrit :
I am trying to integrate junit annotations like @RunWith and few others to be run as part of testng test

@RunWith(XXX.class)  -> junit
public class BaseTestClass {
  
  protected static YYY yy= null;
  protected static zzzz zz = null;
  @BeforeBrowserSession ->junit
  
  starts browser

  }
  

@Test(testname = "test1", dataprovider= "getData"
{
 system.out.println(hello);

}


When I run the test it does not run the junit annotations which is used for starting the browsers, rather just prints the hello. Any help is appreciate. 

--
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.