TestSetItems_LoadByCriteria Operation

Applies to QAComplete 12.80 SaaS, last modified on April 20, 2021

Returns an array of TestSetItem objects that meet the specified condition. If no condition is specified, the method returns all test set items in all tests in the specified projects.

The method returns results in pages (subsets of data) rather than all at once. The number of pages and the number of items each page contains is controlled by the PageSize and PageNumber parameters. For information about working with pages, see LoadByCriteria Operations.

The operation can get test set items from one or several projects. To specify a project to get test set items from, use the ProjId value in the AuthenticationData object in the request body. To get test set items from several projects, use the ProjIds value in the AuthenticationData object to specify the list of project IDs.

Requirements

The user must belong to a security group that has the Read privilege for Test Management > Test Sets.

Parameters

The operation uses the following parameters:

AuthenticationData  :  object, required

An AuthenticationData object with the login information and the ID of the project (or the list of project IDs) that contains test sets whose items you want to get.

Condition  :  string, required

A condition (in XML format) the test sets must meet. Wrap the condition into the CDATA tag or encode XML entities.

If you do not specify a condition, the method will return all test sets in your project.

Sorting  :  string, required

Specifies a property by which the method will sort the test set items. If you do not specify any property for sorting, the method will sort the tests by TestSetId.

PageSize  :  integer, required

Specifies how many test set items a single page contains (from 1 to 200).

PageNumber  :  integer, required

Specifies the number of the page from which you want to get test set items.

Result

An array of the TestSetItem objects that meet the criteria.

Example

Sample Code

C#

string login = "john.doe@example.com";
string password = "p@ssword";

ServiceSoapClient service = new ServiceSoapClient();

// Prepare AuthenticationData
LoginInfo loginInfo = service.GetLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.AppCode = loginInfo.AppCode;
authData.UserId = loginInfo.UserId;
authData.PassCode = password;
authData.DeptId = loginInfo.DeptId;
authData.ProjId = loginInfo.ProjId;

// Specify the condition
string condition =
        @"<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
        xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'>
        <Items Type='tField'>
            <Value xsi:type='xsd:string'>TestSetId</Value>
          </Items>
          <Items Type='tString'>
            <Value xsi:type='xsd:string'>1</Value>
          </Items>
        </Conditions>";

// Specify the sorting
string sorting = "Seq";
// Specify the number of items on a page
int pageSize = 200;
// Specify the number of a page
int pageNumber = 1;

// Get the array of test set items
TestSetItem[] items = new TestSetItem[0];
do
{
  items = service.TestSetItems_LoadByCriteria(authData, condition, sorting, pageSize, pageNumber);
    foreach (TestSetItem item in items)
    {
      // Printing the title of tests that correspond to each item in a test set
      Console.WriteLine(item.Title);
    }
  pageNumber++;
}
while (items.Length == pageSize);

Java

String login = "john.doe@example.com";
String password = "p@ssword";

ServiceSoap service = new Service().getServiceSoap12();

// Prepare AuthenticationData
LoginInfo loginInfo = service.getLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setPassCode(password);
authData.setDeptId(loginInfo.getDeptId());
authData.setProjId(loginInfo.getProjId());

// Specify the condition
String condition =
          "<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n" +
          "  xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'> \n" +
          "  <Items Type='tField'> \n" +
          "    <Value xsi:type='xsd:string'>TestSetId</Value> \n" +
          "  </Items> \n" +
          "  <Items Type='tString'> \n" +
          "    <Value xsi:type='xsd:string'>1</Value> \n" +
          "  </Items> \n" +
          "</Conditions>";

// Specify the sorting
String sorting = "TestSetId";
// Specify the number of items on a page
int pageSize = 200;
// Specify the number of a page
int pageNumber = 1;
List<TestSetItem> items;
do
{
  items = service.testSetItemsLoadByCriteria(authData, condition, sorting, pageSize, pageNumber).getTestSetItem();
  for (TestSetItem item : items)
  {
    // Printing the title of tests that correspond to each item in a test set
    System.out.println(item.getTitle());
  }
  pageNumber++;
}
while (items.size() == pageSize);

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 904 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/TestSetItems_LoadByCriteria"
 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <TestSetItems_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </AuthenticationData>
      <Condition> &lt;Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&#xD;
          xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'&gt;&#xD;
          &lt;Items Type='tField'&gt; &#xD;
            &lt;Value xsi:type='xsd:string'&gt;TestSetId&lt;/Value&gt; &#xD;
          &lt;/Items&gt; &#xD;
          &lt;Items Type='tString'&gt; &#xD;
            &lt;Value xsi:type='xsd:string'&gt;1&lt;/Value&gt; &#xD;
          &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>Seq</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </TestSetItems_LoadByCriteria>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 912 {Insert an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <TestSetItems_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </AuthenticationData>
      <Condition> &lt;Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&#xD;
          xmlns:xsd='http://www.w3.org/2001/XMLSchema' Operation='opEQU'&gt;&#xD;
          &lt;Items Type='tField'&gt; &#xD;
            &lt;Value xsi:type='xsd:string'&gt;TestSetId&lt;/Value&gt; &#xD;
          &lt;/Items&gt; &#xD;
          &lt;Items Type='tString'&gt; &#xD;
            &lt;Value xsi:type='xsd:string'&gt;1&lt;/Value&gt; &#xD;
          &lt;/Items&gt; &#xD;
&lt;/Conditions&gt;
</Condition>
      <Sorting>Seq</Sorting>
      <PageSize>200</PageSize>
      <PageNumber>1</PageNumber>
    </TestSetItems_LoadByCriteria>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 4061 {The server returns an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <TestSetItems_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <TestSetItems_LoadByCriteriaResult>
        <TestSetItem>
          <TestSetItemId>1</TestSetItemId>
          <TestSetId>1</TestSetId>
          <TestId>1</TestId>
          <Seq>1</Seq>
          <IsActive>Y</IsActive>
          <IsStoppedOnFail>Y</IsStoppedOnFail>
          <DateCreated>2014-07-17T08:30:28</DateCreated>
          <DateUpdated>2014-07-20T10:53:07</DateUpdated>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <FolderName>Regression Tests</FolderName>
          <AssignedToName>Doe, John</AssignedToName>
          <UserName>Doe, John</UserName>
          <OwnerName>Doe, John</OwnerName>
          <LastRunByName>Doe, John</LastRunByName>
          <Version>2</Version>
          <ProjId>11873</ProjId>
          <FolderId>12</FolderId>
          <Title>Test input data</Title>
          <TestIsActive>Y</TestIsActive>
          <StatusCode>Approved</StatusCode>
          <ExecutionType>Manual</ExecutionType>
          <TestType>Regression</TestType>
          <Priority>1-High</Priority>
          <TestDateCreated>2014-07-17T08:30:28</TestDateCreated>
          <TestDateUpdated>2014-07-20T10:53:07</TestDateUpdated>
          <TestCreateUserId>24661</TestCreateUserId>
          <TestUpdateUserId>24661</TestUpdateUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <OwnerUserId>24661</OwnerUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <ScriptSourceId>0</ScriptSourceId>
          <NbrFailStatus>2</NbrFailStatus>
          <NbrPassStatus>4</NbrPassStatus>
          <AvgRunTime>375</AvgRunTime>
          <AvgRunTimeFormated>00:06:15</AvgRunTimeFormated>
          <NbrTimesRun>6</NbrTimesRun>
          <LastRunByUserId>24661</LastRunByUserId>
          <LastRunTestSet>2</LastRunTestSet>
          <LastRunTestSetTitle>Regression Tests - Build 3.1.0</LastRunTestSetTitle>
          <LastRunDate>2014-07-20T10:53:07</LastRunDate>
          <LastRunStatus>Passed</LastRunStatus>
          <NbrSteps>10</NbrSteps>
          <NbrEscalations>0</NbrEscalations>
          <DateLastEscalated>0001-01-01T00:00:00</DateLastEscalated>
          <LastEscalationRuleId>0</LastEscalationRuleId>
          <NbrFilesNotSecured>0</NbrFilesNotSecured>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <ScriptName></ScriptName>
        </TestSetItem>
        <TestSetItem>
          <TestSetItemId>2</TestSetItemId>
          <TestSetId>1</TestSetId>
          <TestId>2</TestId>
          <Seq>2</Seq>
          <IsActive>Y</IsActive>
          <IsStoppedOnFail>Y</IsStoppedOnFail>
          <DateCreated>2014-07-17T10:13:16</DateCreated>
          <DateUpdated>2014-07-20T11:14:18</DateUpdated>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <FolderName>Regression Tests</FolderName>
          <AssignedToName>Doe, John</AssignedToName>
          <UserName>Doe, John</UserName>
          <OwnerName>Doe, John</OwnerName>
          <LastRunByName>Doe, John</LastRunByName>
          <Version>6</Version>
          <ProjId>11873</ProjId>
          <FolderId>21</FolderId>
          <Title>Test Tools dialog</Title>
          <TestIsActive>Y</TestIsActive>
          <StatusCode>Awaiting Approval</StatusCode>
          <ExecutionType>Automatic</ExecutionType>
          <TestType>Regression</TestType>
          <Priority>2-Medium</Priority>
          <TestDateCreated>2014-07-18T10:13:16</TestDateCreated>
          <TestDateUpdated>2014-07-20T11:14:18</TestDateUpdated>
          <TestCreateUserId>24661</TestCreateUserId>
          <TestUpdateUserId>24667</TestUpdateUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <OwnerUserId>24661</OwnerUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <ScriptSourceId>0</ScriptSourceId>
          <NbrFailStatus>0</NbrFailStatus>
          <NbrPassStatus>12</NbrPassStatus>
          <AvgRunTime>342</AvgRunTime>
          <AvgRunTimeFormated>00:05:42</AvgRunTimeFormated>
          <NbrTimesRun>12</NbrTimesRun>
          <LastRunByUserId>24667</LastRunByUserId>
          <LastRunTestSet>2</LastRunTestSet>
          <LastRunTestSetTitle>Regression Tests - Build 3.1.0</LastRunTestSetTitle>
          <LastRunDate>2014-07-22T11:14:18</LastRunDate>
          <LastRunStatus>Passed</LastRunStatus>
          <NbrSteps>1</NbrSteps>
          <NbrEscalations>0</NbrEscalations>
          <DateLastEscalated>0001-01-01T00:00:00</DateLastEscalated>
          <LastEscalationRuleId>0</LastEscalationRuleId>
          <NbrFilesNotSecured>0</NbrFilesNotSecured>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <ScriptName></ScriptName>
        </TestSetItem>
      </TestSetItems_LoadByCriteriaResult>
    </TestSetItems_LoadByCriteriaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 4071 {The server returns an appropriate value here}
 

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <TestSetItems_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
      <TestSetItems_LoadByCriteriaResult>
        <TestSetItem>
          <TestSetItemId>1</TestSetItemId>
          <TestSetId>1</TestSetId>
          <TestId>1</TestId>
          <Seq>1</Seq>
          <IsActive>Y</IsActive>
          <IsStoppedOnFail>Y</IsStoppedOnFail>
          <DateCreated>2014-07-17T08:30:28</DateCreated>
          <DateUpdated>2014-07-20T10:53:07</DateUpdated>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <FolderName>Regression Tests</FolderName>
          <AssignedToName>Doe, John</AssignedToName>
          <UserName>Doe, John</UserName>
          <OwnerName>Doe, John</OwnerName>
          <LastRunByName>Doe, John</LastRunByName>
          <Version>2</Version>
          <ProjId>11873</ProjId>
          <FolderId>12</FolderId>
          <Title>Test input data</Title>
          <TestIsActive>Y</TestIsActive>
          <StatusCode>Approved</StatusCode>
          <ExecutionType>Manual</ExecutionType>
          <TestType>Regression</TestType>
          <Priority>1-High</Priority>
          <TestDateCreated>2014-07-17T08:30:28</TestDateCreated>
          <TestDateUpdated>2014-07-20T10:53:07</TestDateUpdated>
          <TestCreateUserId>24661</TestCreateUserId>
          <TestUpdateUserId>24661</TestUpdateUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <OwnerUserId>24661</OwnerUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <ScriptSourceId>0</ScriptSourceId>
          <NbrFailStatus>2</NbrFailStatus>
          <NbrPassStatus>4</NbrPassStatus>
          <AvgRunTime>375</AvgRunTime>
          <AvgRunTimeFormated>00:06:15</AvgRunTimeFormated>
          <NbrTimesRun>6</NbrTimesRun>
          <LastRunByUserId>24661</LastRunByUserId>
          <LastRunTestSet>2</LastRunTestSet>
          <LastRunTestSetTitle>Regression Tests - Build 3.1.0</LastRunTestSetTitle>
          <LastRunDate>2014-07-20T10:53:07</LastRunDate>
          <LastRunStatus>Passed</LastRunStatus>
          <NbrSteps>10</NbrSteps>
          <NbrEscalations>0</NbrEscalations>
          <DateLastEscalated>0001-01-01T00:00:00</DateLastEscalated>
          <LastEscalationRuleId>0</LastEscalationRuleId>
          <NbrFilesNotSecured>0</NbrFilesNotSecured>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <ScriptName></ScriptName>
        </TestSetItem>
        <TestSetItem>
          <TestSetItemId>2</TestSetItemId>
          <TestSetId>1</TestSetId>
          <TestId>2</TestId>
          <Seq>2</Seq>
          <IsActive>Y</IsActive>
          <IsStoppedOnFail>Y</IsStoppedOnFail>
          <DateCreated>2014-07-17T10:13:16</DateCreated>
          <DateUpdated>2014-07-20T11:14:18</DateUpdated>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <FolderName>Regression Tests</FolderName>
          <AssignedToName>Doe, John</AssignedToName>
          <UserName>Doe, John</UserName>
          <OwnerName>Doe, John</OwnerName>
          <LastRunByName>Doe, John</LastRunByName>
          <Version>6</Version>
          <ProjId>11873</ProjId>
          <FolderId>21</FolderId>
          <Title>Test Tools dialog</Title>
          <TestIsActive>Y</TestIsActive>
          <StatusCode>Awaiting Approval</StatusCode>
          <ExecutionType>Automatic</ExecutionType>
          <TestType>Regression</TestType>
          <Priority>2-Medium</Priority>
          <TestDateCreated>2014-07-18T10:13:16</TestDateCreated>
          <TestDateUpdated>2014-07-20T11:14:18</TestDateUpdated>
          <TestCreateUserId>24661</TestCreateUserId>
          <TestUpdateUserId>24667</TestUpdateUserId>
          <AssigneeUserId>24661</AssigneeUserId>
          <OwnerUserId>24661</OwnerUserId>
          <OriginalId>0</OriginalId>
          <ImportId>0</ImportId>
          <ScriptSourceId>0</ScriptSourceId>
          <NbrFailStatus>0</NbrFailStatus>
          <NbrPassStatus>12</NbrPassStatus>
          <AvgRunTime>342</AvgRunTime>
          <AvgRunTimeFormated>00:05:42</AvgRunTimeFormated>
          <NbrTimesRun>12</NbrTimesRun>
          <LastRunByUserId>24667</LastRunByUserId>
          <LastRunTestSet>2</LastRunTestSet>
          <LastRunTestSetTitle>Regression Tests - Build 3.1.0</LastRunTestSetTitle>
          <LastRunDate>2014-07-22T11:14:18</LastRunDate>
          <LastRunStatus>Passed</LastRunStatus>
          <NbrSteps>1</NbrSteps>
          <NbrEscalations>0</NbrEscalations>
          <DateLastEscalated>0001-01-01T00:00:00</DateLastEscalated>
          <LastEscalationRuleId>0</LastEscalationRuleId>
          <NbrFilesNotSecured>0</NbrFilesNotSecured>
          <NbrFiles>0</NbrFiles>
          <NbrNotes>0</NbrNotes>
          <NbrEvents>0</NbrEvents>
          <ScriptName></ScriptName>
        </TestSetItem>
      </TestSetItems_LoadByCriteriaResult>
    </TestSetItems_LoadByCriteriaResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

TestSetItems_Add
TestSetItems_Delete
TestSetItems_Load
TestSetItems_Update
Test Management Operations
Test Set Items Operations
SOAP API Reference

Highlight search results