Tuesday, April 20, 2010

Test Data Creation

http://urtesting.blogspot.com/

Most of the time during testing we put any data in application and test the application behavior and some how thats ok as far as testing team is concern. most of the time we need the valid test data in our test cases similar to the production test data or UAT test data or infact we need the  test data  to validate from a vast array of data .
lets assume we need  the test data for address or telephone number in US or UK  - in this case  we put the test data of our nation and assume that it will workk for US or UK without knowing the pattens of US or UK address or better say the telephone number where the format vary from nation to nation.As a test engineer always in the shoes of end user must replicate the near real test data.

Same problem was with me , as I used to put any junk data and proceeds for testing ,but that was not acceptable as long as you becomes the senior in corporate ladder.

I resolve the problem of Test data that is some how the real test data.

There is a site  -http://www.generatedata.com/#generator 

that generated the test data for testing purposes . And it has the functionality of export in different format as Excel, XML ,HTML etc.


Friday, April 16, 2010

XSD to XML ( from XML schema to XML documents)

http://urtesting.blogspot.com/
We can get XML from XSD by using tools like
1. Eclipse IDE ( java Development Tool)
2. NetBeans IDE
3. Stylus studio.

Let me give the example to create an XML from XSD using tool - stylus studio.( if you don't have download the evaluation version .. I did the same (..)

Lets take an XSD ( from w3 school website- http://www.w3schools.com/schema/schema_example.asp) .. here it is
 <----




 
   
     
     
       
         
           
           
           
           
         

       

     

     
       
              


save this as schema.xsd in notepad .

now open this xsd in stylus studio , this will open the XSD in Diagram view.
select any node and right click - View sample XML.( see above  screen shot). you will get a XML document like this.


.



<?xml version="1.0"?>
<shiporder orderid="string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/Documents%20and%20Settings/sanjeevk/Desktop/schema.xsd">
    <orderperson>string</orderperson>
    <shipto>
        <name>string</name>
        <address>string</address>
        <city>string</city>
        <country>string</country>
    </shipto>
    <!--Element item, maxOccurs=unbounded-->
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
</shiporder>

This a default XML that is generated. Tool has  a setting to generate the other mandatory / optional elements  or attributes as well ..

Tools- Options - XML schema Editor->XML schema to XML
see the screen shot below..



Any question , please leave your comments.