invocation count (how to get instance of current count)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

invocation count (how to get instance of current count)

sunny sachdeva
HI All,

For performance , i needed to invoke my suit 3 times. very recently , instead of FOR loop i switched to invocation count.

what i want to know is is there any way i can get the which instance my method is running i.e i want to know the invocation number

invocationcount=1 , TimeTaken=xx sec
invocationcount=2 , TimeTaken=xx sec
invocationcount=3 , TimeTaken=xx sec

How to get invocationcount number ?

Thanks
Sunny Sachdeva

--
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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invocation count (how to get instance of current count)

sunny sachdeva
I got the solution for my problem.

implemented interface IInvokedMethodListener 
public class invocationListener implements IInvokedMethodListener {

@Override
public void afterInvocation(IInvokedMethod arg0, ITestResult arg1) {
System.out.println("Invocation Count "+arg0.getTestMethod().getCurrentInvocationCount());
System.out.println(arg0.getTestResult().getMethod().getInvocationCount());
}

@Override
public void beforeInvocation(IInvokedMethod arg0, ITestResult arg1) {
// TODO Auto-generated method stub
}



On Monday, September 2, 2013 10:45:04 AM UTC+5:30, sunny sachdeva wrote:
HI All,

For performance , i needed to invoke my suit 3 times. very recently , instead of FOR loop i switched to invocation count.

what i want to know is is there any way i can get the which instance my method is running i.e i want to know the invocation number

invocationcount=1 , TimeTaken=xx sec
invocationcount=2 , TimeTaken=xx sec
invocationcount=3 , TimeTaken=xx sec

How to get invocationcount number ?

Thanks
Sunny Sachdeva

--
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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invocation count (how to get instance of current count)

ann22301@gmail.com
Did you ever get an answer?  This is exactly what I am looking for.

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invocation count (how to get instance of current count)

sunny sachdeva
HI Ann,

Pls check thread just below the question. I have posted answer there.

Thanks
S

On Friday, May 5, 2017 at 10:10:48 PM UTC+5:30, Ann Millikin wrote:
Did you ever get an answer?  This is exactly what I am looking for.

Thanks!



--
View this message in context: <a href="http://testng.1065351.n5.nabble.com/invocation-count-how-to-get-instance-of-current-count-tp18758p23602.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.1065351.n5.nabble.com%2Finvocation-count-how-to-get-instance-of-current-count-tp18758p23602.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLmrGPchzYKwoFJR2qjS4x2ZjiiA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.1065351.n5.nabble.com%2Finvocation-count-how-to-get-instance-of-current-count-tp18758p23602.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLmrGPchzYKwoFJR2qjS4x2ZjiiA&#39;;return true;">http://testng.1065351.n5.nabble.com/invocation-count-how-to-get-instance-of-current-count-tp18758p23602.html
Sent from the testng-users mailing list archive at Nabble.com.

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