testng.xml - Runtime Exception

34 views
Skip to first unread message

Sanju

unread,
Feb 6, 2018, 12:23:56 AM2/6/18
to testng-users
Hi all,
I have mentioned the below code in the testng.xml file and ran it. But getting exception. Please clarify.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Test">
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
</listeners>
<test name="Test1">
<packages>
<package name="com.Test.ABC"></package>
</packages>
</test>
</suite>

Exception:
-------------------

java.lang.IllegalArgumentException: Cannot get property 'href' on null object at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:255) at com.jayway.restassured.internal.path.json.JSONAssertion.getAsJsonObject(JSONAssertion.groovy:53) at com.jayway.restassured.internal.path.json.JSONAssertion$getAsJsonObject.callCurrent(Unknown Source) at com.jayway.restassured.internal.path.json.JSONAssertion.getResult(JSONAssertion.groovy:28) at java.lang.NullPointerException: Cannot get property 'href' on null object at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172) at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) at Script1.run(Script1.groovy:1) 

Krishnan Mahadevan

unread,
Feb 6, 2018, 12:18:48 PM2/6/18
to testng...@googlegroups.com

Please share the sample code that was used to trigger this problem. The stacktrace you shared, doesn’t have anything that might suggest that this is a TestNG problem.

 

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-To: <testng...@googlegroups.com>
Date: Tuesday, February 6, 2018 at 10:53 AM
To: testng-users <testng...@googlegroups.com>
Subject: [testng-users] testng.xml - Runtime Exception

--
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 post to this group, send email to
testng...@googlegroups.com.
Visit this group at
https://groups.google.com/group/testng-users.
For more options, visit
https://groups.google.com/d/optout.

Todd Bradley

unread,
Feb 6, 2018, 12:30:26 PM2/6/18
to testng...@googlegroups.com
Yeah, I use REST-assured with TestNG, too. This is definitely a REST-assured issue, not a TestNG issue. In particular, I bet you're telling it to parse an HTML document as if it were XML. That's likely a sign that your application under test sends the wrong Content-Type header in its HTTP response. But take it up here:


To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.


To post to this group, send email to

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages