Go Back   PassMark Support Forums > Testlog

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2009, 03:28 PM
dionsis dionsis is offline
Junior Member
 
Join Date: Oct 2009
Posts: 4
Default Malformed XML in Testlog Testcases and Suites

Hello

i am writing a small script to dive into the XML database, read the files in there and calculate some report or overview data in a form expected by managers in the company etc.

Using some basic core XML reading functions from PHP i have noticed that some of the XML files are malformed

i consistently get this type of error
Code:
Warning:  simplexml_load_file() [function.simplexml-load-file]: /testlog/live/Projects/Studio 1.1/Project Test Cases/Build 6/Product - Regression/Services.tgp:7: parser error : Extra content at the end of the document in /www/sandbox/testlog/testlog_report_functions.php on line 320

Warning:  simplexml_load_file() [function.simplexml-load-file]: uite> in /sandbox/testlog/testlog_report_functions.php on line 320

Warning:  simplexml_load_file() [function.simplexml-load-file]: ^ in /sandbox/testlog/testlog_report_functions.php on line 320
On checking the file the last 2 lines in the file are

Code:
</test_suite>
uite>
So after the XML file has finished its adding a uite> which is causing the XML to be malformed and unreadable.

If i go back into Testlog again and Edit the folder again and dont even update it, just click edit, then ok. It updates the file again and fixes it.

In our system we have hundreds of suites and thousands of testcases, so we cant be cleaning up after testlog errors everywhere its just not practical. Is this a bug? Is it known? Is there a solution like a function for testlog which will validate each files format (like editing and click ok without having to manually do it) So i can gauruntee the integrity of the files meaning i can guaruntee the integrity of the report i generate

Thanks

Aidan
Reply With Quote
  #2  
Old 10-28-2009, 05:17 PM
dionsis dionsis is offline
Junior Member
 
Join Date: Oct 2009
Posts: 4
Default

it should be noted that added to the

Code:
</test_suite>
uite>
I have been scanning through other files and the errors are different among some of them, including a double closer

Code:
</test_suite>
</test_suite>
even less

Code:
</test_suite>
ite>
Code:
</test_suite>
_suite>
Code:
</test_suite>
 e>
Code:
</test_suite>
  /test_suite>
Always the Closing Tag, Different error as i scan through hundreds of suites reading in the tgp file.

I have previously gotten errors on Testcases which i will detail as i can show and prove them
Reply With Quote
  #3  
Old 10-28-2009, 05:59 PM
dionsis dionsis is offline
Junior Member
 
Join Date: Oct 2009
Posts: 4
Default

Got an error or 2 with Testcases aswell

Extra content at the end of the XML files causing problems, seems to be related entirely to the closing tag of the testcase file too

Whilst Editing of a Suite would fix the XML (as a temp solution) Editing and changing nothing on a testcase does not do the same thing, however, if i edit a testcase and enter a Space (just hitting the spacebar) on an empty field and click ok, it seems to solve the testcase issue with extra content at the end

Again with 30,000-40,000 Testcase this becomes a huge problem.
Reply With Quote
  #4  
Old 10-28-2009, 11:55 PM
TimR's Avatar
TimR TimR is offline
Employee
 
Join Date: Mar 2005
Posts: 658
Default

This sounds like a bug that was fixed in the last build;
  • Fixed a bug where renaming a test suite to a shorter name could write extra (unnecessary) XML to the saved file
  • Fixed a bug where editing an item in the web version and removing extra information could leave extra (unnecessary) XML in the saved file
In both cases extra information was left at the end of the file (the end of file pointer wasn't being repositioned correctly after information was removed)

Updating to the new version won't immediately correct the problem in the test cases that have been affected but will prevent it from happening again (they should be returned to normal next time they are edited).
Reply With Quote
  #5  
Old 10-29-2009, 11:24 AM
dionsis dionsis is offline
Junior Member
 
Join Date: Oct 2009
Posts: 4
Default

Ok, well ive sent the latest version around to the group to ensure they are on the latest build, but even before this fix build came out all of these problems would have been continually mounting on a broken build.

Is there any method to once off correct the testcases? a once off run through to re-validate the XML, or a build of testlog that as its initially reading the files would open and edit and revalidate the XML of each testcase as it reads it.

Even if this was a once off tool that was inefficient and slow, it would be 100 times faster than myself having to manually correct thousands of files
Reply With Quote
  #6  
Old 10-30-2009, 01:28 AM
TimR's Avatar
TimR TimR is offline
Employee
 
Join Date: Mar 2005
Posts: 658
Default

We should be able to create a special build to do something like this upon opening the database, could you please email me at timr [at] passmark [dot] com and we'll send you new build.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:59 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright PassMark Software Pty Ltd 2007