dependsOnMethods

32 views
Skip to first unread message

Deepak Ratan

unread,
Sep 17, 2022, 3:48:02 AM9/17/22
to testng-users
Hello Team,

I am doing the automation testing with the TestNG framework for the e-commerce website using dependsOnMethods feature.

I have 640 methods and need to run them in order, but it did not happen.
So I used my test method name as - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,  AB, AC, AD, AE, AF, AG, AH, AI, AJ, AK, AL, AM, AN, AO, AP, AQ, AR, AS, AT, AU, AV, AW, AX, AY, AZ

In this case, also this was not happening, and we cannot use priority also when we are using dependsOnMethods feature

How can we run the 640 methods in order?

--
Regards
Deepak Ratan J
Software Tester

⇜Krishnan Mahadevan⇝

unread,
Oct 2, 2022, 5:38:19 AM10/2/22
to testng...@googlegroups.com
Deepak,

You can do something like this to solve your problem.
  • Build an implementation of the interface org.testng.IMethodInterceptor
  • Now within this implementation, inside the intercept() method, build a sorting logic that will help you order the methods in whatever order you want (You should sort the List<IMethodInstance> object and then have it returned back by this method.
  • Use one of the approaches as detailed in this blog of mine to wire in your listener.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.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 testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/a30b6f9a-0c05-4cdb-9965-48a699a127edn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages