Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

More XML Import Help


#1

Sorry to be such a pain … but I am running into yet another, perhaps limitation, of importing via XML.

I have say a few 100 testcases that I need to import. They all live under a half dozen folders at the top level in a testsuite; so something like:

Folder A
   10 testcases
Folder B
   15 testcases
Folder C
   50 testcases
....etc...

my XML for the import looks as such:

<?xml version="1.0" encoding="UTF-8"?>
<sections>
  <section>
    <name>Folder 1</name>
    <cases>
         ...10 testcases...
    </cases>
  </section>
</sections>
<sections>
  <section>
    <name>Folder 2</name>
    <cases>
         ...15 testcases...
    </cases>
  </section>
</sections>
<sections>
  <section>
    <name>Folder 2</name>
    <cases>
         ...50 testcases...
    </cases>
  </section>
</sections>

Alas, the above XML file gives me an error, because the entirety of those sections needs to be wrapped up in yet another section to live under, so the following would work (abbreviated):

<?xml version="1.0" encoding="UTF-8"?>
<sections>
  <section>
    <name>TOP LEVEL FOLDER</name>
    <sections>
      <section>
        <name>Folder 1</name>
      </section>
    </sections>
    <sections>
      <section>
        <name>Folder 2</name>
      </section>
    </sections>
    <sections>
      <section>
        <name>Folder 2</name>
      </section>
    </sections>
  </section>
</section>

The problem there, of course, is now I have this top level folder called “TOP LEVEL FOLDER” that all my folders live under. Those folders I import are unable to live at the top level unless I import each folder individually. Quite the pain when we have upwards of 150 folders (of course, doable… but a pain).

Is there some XML that I am missing that will accomplish this?

Thanks!


#2

Well, it took me all of 2 minutes to figure this out … I guess I should have spent another minute to investigate.

It’s the XML tag that I didn’t have around everything. Doh!

All better now.


#3

Great to hear that, Jim!

Regards,
Tobias