Results 1 to 3 of 3

Thread: XML Testing

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    XML Testing

    Can any one tell me about XML testing. How it is done? Where I can find more information about how it is done etc.,


  2. #2
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Re: XML Testing

    Hi Apabbati,

    XML testing can be under 2 scenarios.
    1) Validating the Structure of XML.
    2) Comparing Nodes and Properties.
    3) Comparing XML file against a Standard XML format to find differences.

    Validating the Structure of XML.

    Sometimes the AUT would return result-sets in XML formats. Meaning as an output of any operation carried out in the application, an XML fiel could be generated.
    As part of testing we would need to validate the Structure of the XML in terms of Parent - Children nodes. We would also need to ascertain Node properties and Attributes.

    Comparing Nodes and Properties.

    Testing scope in this would involve extracting Specified Nodes and their Attribute values and checking whether valid data was actually posted in these.

    Comparing XML file against a Standard XML format to find differences.

    In the above scenario, XML files from 2 environments would be compared. It should not be a textual comparision, as it would be ineffective. It would be Node based comparision where Every Parent node would be compared in terms of Child Nodes, attributes etc.
    Overall structure of both XML's would be compared.

    Testing Methodology.

    XML testing could be carried out manually incase the number of XML results / files is very less. Say 1 or 2 but comparing larger number of XML files would be difficult.

    We genreally use automated code to perform the same. We could use something on following lines. Please NOTE this is a sample code only.

    set xmlDoc=CreateObject("Microsoft.XMLDOM")
    xmlDoc.async="false"
    xmlDoc.load("C:\Google.xml")

    for each x in xmlDoc.documentElement.childNodes
    msgbox(x.nodename) & ":" & (x.text)
    next


    The above code would iterate through the XML file and return all asoociated ChildNode names.

    Cheers...


  3. #3
    Banned
    Join Date
    Oct 2007
    Answers
    173

    Re: XML Testing

    XmlTestSuite provides a powerful way to test web applications.

    Check site structure:
    HTML pages are well formed and links are valid

    Check the content of pages
    Use Javascript variables, XPath expressions, database queries

    Check the way the site works:
    Run test scanarios, written in XML
    The main aims of XmlTestSuite are

    Tests are written in XML
    Allows use of syntax checking XML editors.
    We use the excellent free editor jEdit.


    Tests scripts are robust to changes in the application
    Using xpath expressions you can check the important parts of the HTML and ignore the decoration


    Writing tests requires only a knowledge of HTML and XML
    We wanted XmlTestSuite to be adopted by testers, business analysts,
    and web developers who don't have a java background.
    (advanced usage may require use of simple xpath expressions.
    See the dtd manual for some examples).


    Testing encompasses all parts of the system including the database and file system.
    XmlTestSuite can verify that certain tables are updated when a certain page is submitted.
    After the tests have been completed it can suggest the sql necessary to clean up the database.
    It can also perform xpath evaluations on local files.


    Test environment is easily extended (see the Api for details)
    New test classes can be added by including them in the java classpath
    New resources for test classes can be added almost as easily


    Enables test driven development
    We have used XmlTestSuite to develop tests for existing applications.
    We have also used it for new applications, where the tests form part of
    the specifications, and are used during the development phase.


    Enables functional testing


    Full compatibility with junit
    This allows the use of the standard junit test runner applications.
    Developers can use it with IDE frameworks (jEdit, Eclipse)

    Please read the installation notes and the introduction for further details.

    Changes in version 1.2

    Addition of a domain tag which maps a domain name to an ip address, bypassing the normal DNS lookup for the specified name. Useful when testing in a web farm environment or on a laptop.

    Changes in version 1.1

    Support for javascript variables and expressions.
    Uses the latest version of Httpunit, which uses a faster parser, which is also more tollerant of non-standard Html constructs.
    Allows multiple tests scripts in a dorectory to be run by supplying a directory name
    New tag to define the browser attributes, including window size.
    New