Search code examples
c#restalm

HP ALM Accessing Test Plan via REST API (C#)


I am trying to access test set data in QC/ALM via C# and the REST API, but I am struggling to with path navigation.

In Test Lab we have a path of:

Root
  UnitTests
    QA-US
    QA-UK
      Product1
        ...
      Product2
        Test Campaign 1
        Test Campaign 2
          RC 1
          RC 2

I am trying to access test run details for a campaign (e.g. Test Campaign 1, RC 2) but I can't figure out how I do this.

I looked at this Stack Overflow question but I couldn't figure out the hierarchy path.

I attempted to use: http://IP:PORT/qcbin/rest/domains/THEDOMAIN/projects/THEPROJECT/test-set-folders?query={name['Root']} and get details back, but if I want a want a deeper path .. e.g. 'Root\UnitTests\QA-UK\Product2\Test Campaign 1\RC 1' it fails to be found.

Any assistance would be greatly appreciated.


Solution

  • You can get folder level sets using following way. Filter on name will not work. You need to filter on parent-id. Even though it is id field still HP accepts folder name. Following query works on my HPALM instance and hopefully it will work with yours as well.

    http://host:port/qcbin/rest/domains/DEFAULT/projects/TestP/test-sets?query={parent-id[^Root\Path 1\Path 2^]}. 
    

    Regards

    Gaurav