SOAP API - Get root test case (folder)

Thursday, November 27, 2014 5:40:05 AM

Hi,

I would like to get a list of the 'root folders' trough the SOAP API. I can either use:

  • TestCase_RetrieveByFolder(int testCaseFolderId). But how do I get the root folder? From there, I can browse the rest of the tree.
  • TestCase_Retrieve(ArrayOfRemoteFilter? remoteFilters, int startingRow, int numberOfRows) with using a filter on the IndentLevel parameter. However, this seems not to be working as expected.

In the last code, I used (for testing):

var Filter = new RemoteFilter();
Filter.PropertyName = "IndentLevel";
Filter.StringValue = "AAA";

var RootTestCases = Client.TestCase_Retrieve(remoteFilters: new RemoteFilter[] { Filter }, startingRow: 1, numberOfRows: 50);

However, it still gives me all results ignoring the filter. What am I doing wrong?

3 Replies
Monday, December 1, 2014 3:59:15 PM
Avatar
re: Loenhoet on Thursday, November 27, 2014 5:40:05 AM
Hi Stefan

I have just checked and there is not a way to get the root test cases at present I'm afraid with a single call.
You'd need to basically call the main TestCase_Retrieve(...) function to get a list of test cases in the project and then loop through and only use the ones that have an IndentLevel of three characters in length (e.g. AAA, AAB, AAC, etc.)

Regards

Sarah
Monday, December 1, 2014 11:27:12 PM
Avatar
re: inflectra.sarahx on Monday, December 1, 2014
Hi Sarah,

thank you for the answer. The reason why I was looking for this is because we have a quite slow connection between our offices. So, I thought, if I can find the root elements first, I can browse the whole tree from there ...

But for now I can just download all the test cases first before we can continue, it is also acceptable for now.
Monday, December 1, 2014 11:27:13 PM
Avatar
re: inflectra.sarahx on Monday, December 1, 2014
Hi Sarah,

thank you for the answer. The reason why I was looking for this is because we have a quite slow connection between our offices. So, I thought, if I can find the root elements first, I can browse the whole tree from there ...

But for now I can just download all the test cases first before we can continue, it is also acceptable for now.
Statistics
  • Started: Thursday, November 27, 2014 5:40:05 AM
  • Last Reply: Monday, December 1, 2014 11:27:13 PM
  • Replies: 3
  • Views: 694