正常是可以运行的
如果加了测试类到监听类中,就报下面的错误
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.ClassCastException: com.lemon.testcases.LoginTestV3 cannot be cast to org.testng.ITestNGListener
at org.testng.TestNG.addListeners(TestNG.java:949)
at org.testng.TestNG.initializeConfiguration(TestNG.java:912)
at org.testng.TestNG.initializeEverything(TestNG.java:996)
at org.testng.TestNG.run(TestNG.java:1009)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)