TestProject Forum

Adding a project parameter to get current URL step results in a java.lang.NullPointerException failure

Hello,
In my tests I’ve had a validation step where it gets the current URL and validates it by using a project parameter.
It has been failing since I upgraded to v2 of test project.
Here is the failure in the logs (please note I am using a fake URL in this post but the test has a working URL)

2021-03-30 15:21:54.313 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 qtp1634007253-8 i.t.a.w.r.e.RecordingEndpoints Received request to update recording session parameters
2021-03-30 15:21:54.323 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Started processing Step 08kuy9rqnE6SHYsWkFegpQ (9) in Test null
2021-03-30 15:21:54.323 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Step Code Block Class Name: io.testproject.agent.codeblocks.driver.GetCurrentUrl
2021-03-30 15:21:54.324 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Executing ActionStep: 1.9. Get current URL
2021-03-30 15:21:54.324 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Step 08kuy9rqnE6SHYsWkFegpQ defines a timeout of 15000ms
2021-03-30 15:21:54.337 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Removing driver implicit timeout
2021-03-30 15:21:54.340 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Step 08kuy9rqnE6SHYsWkFegpQ (1.9) in Test 08kuy9rqnE6SHYsWkFegpQ execution Finished.
2021-03-30 15:21:54.340 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 pool-2-thread-3 i.t.a.m.d.q Step 08kuy9rqnE6SHYsWkFegpQ (1.9) in Test null - Passed! (URL is: https://someurl.com).
2021-03-30 15:21:54.341 xk90g6ZIx0CFIE9ccWvE8g ERROR 48147 rec-step-exec i.t.a.m.d.w Exception occurred during step 08kuy9rqnE6SHYsWkFegpQ execution
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at io.testproject.agent.managers.d.w.a(TestProjectAgent:766)
at io.testproject.agent.managers.d.w.b(TestProjectAgent:678)
at io.testproject.agent.managers.recording.d.a(TestProjectAgent:1927)
at io.testproject.agent.e.b.a.L.a(TestProjectAgent:459)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.testproject.agent.c.d.run(TestProjectAgent:33)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.NullPointerException: null
at io.testproject.agent.managers.d.j.a(TestProjectAgent:171)
at io.testproject.agent.managers.d.o.a(TestProjectAgent:482)
at io.testproject.agent.managers.d.q.a(TestProjectAgent:2575)
at io.testproject.agent.managers.d.q.a(TestProjectAgent:299)
… 5 common frames omitted
2021-03-30 15:21:54.341 xk90g6ZIx0CFIE9ccWvE8g INFO 48147 qtp1634007253-3 i.t.a.w.r.e.RecordingEndpoints Step Failed with message: java.lang.NullPointerException

If I remove the step and manually add the same step with no validation using a project parameter, it works. If I add a validation “equals https://someurl.com” it also works.
Adding a project parameter in the validation throws that error. Let me know if I’m missing something or if I should create a ticket out of this or if I’m just doing it wrong somehow.

Hello @erick.caceres
Can you please send the full agent logs to our support email?
support@testproject.io
Thanks.

Email sent to the support email, thanks!