Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Excel to use hierarchical data with more than one level, how to use ParentIndex correctly

Options
paolabs
paolabs Posts: 16

I have been using this information to create my excel data source with hierarchical data:
https://docs.parasoft.com/display/SOAVIRT9104/Performing+Functional+Tests+Using+Data+Sources

In my service I have the following structure:

  <SetupProducts>
   <shortId></shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId></ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode></RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

Having the correct structure was doing weird things, so I took the example exactly and tried to make sense of it. Running this, I would expect to have Grandpa as the shortid, daddy as the rate code, and then have two ChannelAssignmentDTO, where channel ids will be FirstSon and SecondSon. Instead this was what it generated for me, which is mostly ok except that Second son is missing.

  <SetupProducts>
   <shortId>Grandpa</shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstSon</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>Daddy</RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

And the Grandma case is even worse:

  <SetupProducts>
   <shortId>Grandma</shortId>
   <products>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstDaughter</ChannelId>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId/>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId>FirstCousin</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>Mommy</RateCode>
    </ProductDTO>
    <ProductDTO>
     <AssignedChannels>
      <ChannelAssignmentDTO>
       <ChannelId>FirstDaughter</ChannelId>
      </ChannelAssignmentDTO>
      <ChannelAssignmentDTO>
       <ChannelId>SecondDaughter</ChannelId>
      </ChannelAssignmentDTO>
     </AssignedChannels>
     <RateCode>First Aunt</RateCode>
    </ProductDTO>
    <ProductDTO>
     <AssignedChannels/>
     <RateCode>Second Aunt</RateCode>
    </ProductDTO>
   </products>
  </SetupProducts>

As you can see, the Mommy node has first daughter, empty and first cousin, so second daughter is missing; First aunt has data when it shouldn't have (wrong data at that) and Second aunt has nothing.

I think this is a matter of parent index in the third gen, it doesn't quite match properly. Anyone has seen something like this?

Tagged:

Comments

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    Hierarchical data in Excel can be difficult to set up. Data repository handles hierarchical data for payloads much more easily - I would consider using that instead.

Tagged