Description

GenRocket lets you quickly define and generate test data for complex nested Extensible Markup Language (XML) documents by importing an XML Schema Definition (XSD) that formally describes the elements and nesting in an XML Document. 


An XSD enables GenRocket to automatically create Domains, Attributes, and other necessary components that represent the XML document. By importing an XSD into the GenRocket web platform, you're just a few steps away from Generating any of the XML test data necessary for your test cases.


In This Article


XML Schema Definition (XSD) Structure

For more information regarding the XML Schema Definition (XSD) Structure, click here


Component Diagram

The Component Diagram below shows how XSD elements are represented by GenRocket Components.

  • An <xs:complexType> is represented by a GenRocket Domain
  • An <xs:element> is represented by a GenRocket Attribute
  • An <xs:attribute> is represented by a GenRocket Attribute 

 


What Gets Created During the Import? 

Behind the scenes, when GenRocket is parsing an XSD, it utilizes all of its five key components (Domains, Attributes, Generators, Receivers, and Scenarios) plus additional GenRocket components (Scenario Chains, Scenario Chain Sets, and Configuration File).  


When processing the information extracted from an XSD, a lot of things start to happen:  

  • For each XSD ComplexType, GenRocket creates a Domain and its Attributes. 
  • For each Domain, GenRocket attaches a SegmentDataCreatorReceiver.
  • It also creates a Merge Domain and attaches the XMLSegmentMergeV4Receiver, which is used to merge the segments of generated data.
  • For each Domain, GenRocket creates a Scenario.
  • For each set of 25 Scenarios, GenRocket creates a Scenario Chain.
  • For each set of 25 Scenario Chains, GenRocket creates a Scenario Chain Set.
  • GenRocket creates a Configuration file - used by the XMLSegmentMergeV4Receiver to configure and create an XML document.


This is why giving GenRocket an XSD to automatically parse and process to create all of the necessary GenRocket components is necessary; GenRocket can do this in seconds or minutes, which would manually take you hours or days to complete. 


How to import Domains from XSD

  • Select a Project and Project Version in the Project Dashboard.
  • Expand the New Domain menu and select the Import from XSD option.


  • Click the Choose File button. This will bring up a dialog to select a file from your computer.  
  • Select the file and click Save.



    Note: The dialog will filter only the files with the .xsd extension.



  • You will see the following message. Click the OK button.



  • Then, wait for an email notifying you when the import is completed; it should only take a few minutes.


Next Steps

After the import, users can do the following to generate their data. If you need to generate a different output format, you can assign a different merge Receiver.

  1. Modify GeneratorsGenRocket will utilize its data warehouse and do its best to assign an appropriate Generator to each Domain Attribute; however, you may need to modify a few of the Attribute Generators or their parameters to generate the exact type of data you need for your test cases. This can be done in one of two ways: 
  2. Set loopCountsBy default, GenRocket will set the loopCount on each Domain to 1. You will need to modify the loopCounts on the Domains where you want more than one element of data to be generated. Click here to learn more.


  3. Download config.xml file - The config.xml file must be downloaded and placed in the path defined within the XMLSegmentMergeV4Receiver config parameters.


    Click on the Download icon within the Management pane to download this file to your local computer. This step is not necessary when using G-Repository Server and Client.


  4. Download the Scenario Chain Set - Download the created Scenario, Scenario Chain, or Scenario Chain Set. This step is not necessary when using G-Repository Server and Client.


  5. Run the Command - Click here to see how to run a Scenario and generate test data.