No tests found in TestClass Haven't you forgot @Test annotation?
The method needs to be explicitly declared as public
:
@Test
public void asdf() {
asdf...
}
I got this exception even though I had a public method annotaded with @Test
. Turned out was importing org.junit.jupiter.api.Test
, I changed to org.junit.Test
and it worked fine.
Import junit package in stead of testng package.