How to resolve : " org.testng.TestNGException - Cannot Instantiate class"

43 views
Skip to first unread message

Saibalu R

unread,
Feb 21, 2024, 6:03:56 AMFeb 21
to testng-users
Hi Guys,

I attempted to execute a code that functioned correctly yesterday, but it is now generating a TestNGException error. 

Could someone assist me in resolving this issue?

WhatsApp Image 2024-02-21 at 14.21.41_459497d2.jpg

Krishnan Mahadevan

unread,
Feb 21, 2024, 7:34:54 AMFeb 21
to testng...@googlegroups.com
Its not possible to say what is going on without you showing us the code that you are using to trigger this problem.

So please share the code that you are using, which is causing this issue.

In a nutshell, you seem to have something in your test class constructor that is throwing an exception, which is causing the instantiation of your test class to fail. So TestNG is telling you that it had issues when it tried to create a new instance of your test class using reflection.


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/

On 21-Feb-2024, at 3:30 PM, 'Saibalu R' via testng-users <testng...@googlegroups.com> wrote:

Hi Guys,

I attempted to execute a code that functioned correctly yesterday, but it is now generating a TestNGException error. 

Could someone assist me in resolving this issue?

<WhatsApp Image 2024-02-21 at 14.21.41_459497d2.jpg>

--
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/0f6f8a8f-8e60-44b5-a11f-9b4630ea1312n%40googlegroups.com.

Saibalu R

unread,
Feb 23, 2024, 2:04:13 AMFeb 23
to testng-users
Thanks, Krishnan for your prompt response.

The test cases were functioning correctly on the previous day, and I did not make any new code modifications to that specific module.

Surprisingly, the code appears to be working fine at the moment, even though no new changes were implemented

Once again thanks for your support.

Reply all
Reply to author
Forward
0 new messages