Null java.lang.AssertionError: expected [true] but found [false]

1,928 views
Skip to first unread message

SuRiNdEr Komire

unread,
Sep 21, 2015, 9:00:37 AM9/21/15
to Selenium Users
Hi All,

When I execute the scripts in local machine, test scripts are running fine but when I run the same on Jenkins server, test scripts are failing.
I'm using TestNG and hybrid frameworks. When i execute testsuit, will fail some test cases but when i debug the same failed test cases, i could not find any error in my script and scripts are running fine. 


Is it synchronization problem or code Problem??

Please suggest me how to overcome this problem !!!

Krishnan Mahadevan

unread,
Sep 21, 2015, 9:56:39 PM9/21/15
to Selenium Users
There's hardly any information in your mail for anyone to even get started with trying to help you.
You would need to add more contextual information that explains in detail what exactly is your issue.

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 Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/83bd8ae3-58fb-4ba1-8282-842a0c07a10f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SuRiNdEr Komire

unread,
Sep 22, 2015, 4:35:16 AM9/22/15
to Selenium Users
In one class there are 43 @Test annotations. When i execute all @Test (testcases) at a time, around 6 to 7 testcases will fail. But when i check/execute individual failed testcase (@Test) i could not find any error.
I'm unable to find the problem. How to overcome this problem. Is it due to synchronization or timeout exception problem??. In report i'm getting similar kind of errors like (Test_Upload_License_TEMPORARY:null
java.lang.AssertionError: expected [true] but found [false]). 

Krishnan Mahadevan

unread,
Sep 22, 2015, 10:14:05 PM9/22/15
to Selenium Users
Surinder,

As frustrating as it sounds, you still aren't giving us a lot of information to help you out here. 
If the problem is surfacing ONLY when you run all your tests together at the same time then it very well means that there is a problem in your test code. 

As long as all your @Test annotated test methods are self sufficient (i.e., they don't make use of any variables defined as data members in the class and which get initialised by another @Test method ), you should never see such sporadic NullPointerExceptions.

So either you deep dive into your test to see what data is being shared across your @Test annotated test methods and fix them such that there is no such sharing, or you show us a simple reproducible test that can recreate the problem.

Oh btw, I don't think this problem is any  more a Selenium WebDriver problem, but seems to be more related to your @Test method [ TestNG google groups would be a better place to ask this question, but even there I am going to tell you the same thing that I already said here :) ]



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 Scribbings @ http://rationaleemotions.wordpress.com/

Reply all
Reply to author
Forward
0 new messages