Announcement

Collapse
No announcement yet.

Malformed XML in Testlog Testcases and Suites

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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() [[URL="http://qa01.cr2.local/sandbox/function.simplexml-load-file"]function.simplexml-load-file[/URL]]: /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() [[URL="http://qa01.cr2.local/sandbox/function.simplexml-load-file"]function.simplexml-load-file[/URL]]: uite> in /sandbox/testlog/testlog_report_functions.php on line 320
    
    Warning:  simplexml_load_file() [[URL="http://qa01.cr2.local/sandbox/function.simplexml-load-file"]function.simplexml-load-file[/URL]]: ^ 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

  • #2
    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

    Comment


    • #3
      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.

      Comment


      • #4
        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).

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment

            Working...
            X