Corrupt TestNg result xml.

40 views
Skip to first unread message

Martin Aldrin

unread,
May 25, 2016, 4:22:37 AM5/25/16
to testng-users
We have got a problem to parse testNg results xml file.

I get following error message when I open up the xml in firefox.
XML-tolkningsfel: ej välformat
Adress: testng-results.xml
Radnummer 371, Kolumn 10:.....]0;
---------^

if I open the file in nedit I can see following escape/controll characters. So it seems that TestNg do not encode the text within
CDATA correctly.

<esc>]0;<bel>

⇜Krishnan Mahadevan⇝

unread,
May 25, 2016, 4:23:47 AM5/25/16
to testng...@googlegroups.com
Martin,
Can you please help share a sample that can be used to recreate the 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/

--
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.

Martin Aldrin

unread,
May 25, 2016, 9:27:51 AM5/25/16
to testng-users
Hi,

I have attached a sample file.

/Martin
corruptTestNg.xml

Krishnan Mahadevan

unread,
May 25, 2016, 11:45:53 AM5/25/16
to testng-users

Martin

Since am not that familiar with this part of the testng codebase I was hoping that you would share a test which I could execute to recreate the problem.
That way I could try and setup debug points to figure out what is going wrong.

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/




Martin Aldrin

unread,
May 25, 2016, 3:08:09 PM5/25/16
to testng-users
Hi,

to reproduce a similar behavior I think the easiest way would be to cat the text inside the "CDATA" and throw a exception that contain this message.

I tried it with this simple test, you need to cut the test directly from the file into the exception to get the same escape characters.


 @Test()
    public void test(){
        throw new MsranJcatException("");
    }


/Martin

⇜Krishnan Mahadevan⇝

unread,
Jun 4, 2016, 10:52:50 AM6/4/16
to testng...@googlegroups.com
Martin,

It would be good if you can please share a reproducible test. Currently I cant even use any of the DOM Parsers to work with the xml file because all of them complain stating that there's an illegal character.

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