Description

An XML Schema Definition (XSD) contains a choice element, which allows only one of the elements within the <choice> declaration to be present within the element. 


An XSD can be imported into GenRocket to automatically create Domains, Attributes, and other necessary components that represent an XML document. The element selections for the choice element within a created Domain are not tagged automatically.

The XSD Choice Option has been created to make it easy to select (or tag) each element that should be within the <choice> declaration for Domains created during the import process. 


Note: This article shows how to use the XSD Choice Option after importing the XSD file. 


In This Article


What is the XSD Choice Option?

  • The XSD Choice Option will be present within the Domain Dashboard for any Domain created via an XSD Import.

  • It can be used to select current Attributes of a Domain or Children of a Domain as element selections within the  <choice> declaration when generating data for the Domain. 


When should the XSD Choice Option be used? 

  • Any time the elements for a <choice> declaration need to be selected (or tagged) and used to generate data for the Domain.


How does the XSD Choice Option work? 

  1. Select and view a Domain within the Project Dashboard.
  2. Click on the Choice Selection button within the Domain Dashboard.
  3. Select Attributes or Children of the Domain within the dialog window.
  4. Add the Choice Group to the Domain.

 

Note: Once set up, the user will need to download the Scenario, Scenario Chain, or Scenario Chain Set along with any needed configuration files to generate their test data.

Sample XS Choice and Elements

<xs:element name="person">
<xs:complexType>
<xs:choice>
<xs:element name="employee" type="employee"/>
<xs:element name="member" type="member"/>
</xs:choice>
</xs:complexType>
</xs:element>


Prerequisite - Import the XSD File

The XSD file must be imported into a selected Project Version of a given Project. After the import, the XSD Choice Option will be available for every Domain created from the imported XSD file.


Step 1 - Select a Domain to view within the Project Dashboard

Select a Domain within the Domains Pane in the Project Dashboard. The Domain will be displayed within the Domain Dashboard




Step 2 - Click on the Choice Selection Button

Next, click on the Choice Selection button within the Domain Dashboard



Step 3 - Select Attributes or Children of the Domain 

Users can select one or more Attributes or Children of the Domain within the dialog window. This will determine what elements are available for generating data within the <choice> declaration.



Click on the Search field above the Attributes and Children columns to enter a search keyword. The result will be displayed automatically as the keyword is entered. 



Click on an item within the Attributes column or the Children column to select it. Selected items will be highlighted in blue. 



Note: Select multiple Attributes or Children within the dialog window by using a Shift/Click or CTRL/Click combination. 



Step 4 - Finish Adding the Choice Group to the Domain

Once finished, click the Add Choice Group button within the Choice Group Selection dialog window.


A grChoiceSelection Attribute will be created automatically and used when generating data for the Domain. 



The grChoiceSelection Attribute will be assigned the EvalChoiceActionGen Generator with list Parameter values for the selected Attributes or Children of the Domain.