Java TestNG';s getCurrentInvocationCount()太高?
我有一个测试监听器类,使用Java TestNG';s getCurrentInvocationCount()太高?,java,count,testng,invocation,Java,Count,Testng,Invocation,我有一个测试监听器类,使用扩展AbstractWebDriverEventListener实现ITestListener,IInvokedMethodListener 在调用之前的中调用ITestNGMethod.getCurrentInvocationCount()返回0 在afterInvocation中,调用ITestNGMethod.getCurrentInvocationCount()返回2 这只是一个测试,为什么调用完成后计数为2? 不是应该是1吗 我将断点设置为org.testng
扩展AbstractWebDriverEventListener实现ITestListener,IInvokedMethodListener
在调用之前的中
调用ITestNGMethod.getCurrentInvocationCount()
返回0
在afterInvocation
中,调用ITestNGMethod.getCurrentInvocationCount()
返回2
这只是一个测试,为什么调用完成后计数为2?
不是应该是1吗
我将断点设置为org.testng.internal.BaseTestMethod.java的incrementCurrentInvocationCount()
,它在IvokeMethodRunnable.java
中调用一次,然后在testng方法完成后在Invoker.java
中再次调用
调用计数为2意味着它被称为1?它被称为2??)