cancel
Showing results for 
Search instead for 
Did you mean: 

Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 14

New Contributor

Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 14

Hello, 

 

I am getting the following error when trying to run tests on my Production environment:

 

Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 14

 

The weird part is I can run these tests succufully on my Dev, QA and UAT environments without an issue. The other strange thing is I am using this Test Step in multiple testcases.  I have around 100 tests in my stuite, and roughly 15 are failing on the same TestStep in Production environment only.  The tests are GET calls.  I have attached the error message and code.

 

Thanks!

 

 

7 REPLIES 7
Occasional Contributor

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

Have you checked to see if the response you are getting from production contains that header? The error you are getting makes me think that the header you are looking for is not being returned in the produciton response.

New Contributor

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

I checked the header responses in all environemnts and they are the same.

Community Manager

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

Hi @shutch,

Was the solution found for this question?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Contributor

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

@TanyaGorbunova , no I have not been able to find a solution

Community Hero

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

What, exactly, is providing this error? A groovy script assertion? Something else? More details would be appreciated! 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
New Contributor

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

@msiadak , Its failing to create the cookie. Without the cookie the assertions fail.  In my original post I attached the code and error message

Community Hero

Re: Error java.lang.NullPointerException: Connot invoke method get() on null object error at line: 1

So if this works in one environment and not the other, as indicated by previous posters, it sounds like the responses may be different. You said that's not the case, but to troubleshoot your groovy script, we'd need a response from each environment to see what we're working with. 

 

Sanitize it if you need to, but without that it's going to be taking stabs in the dark. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
New Here?
Join us and watch the welcome video:
Top Kudoed Authors