Tests_Update Operation

Applies to QAComplete 14.3, last modified on February 19, 2024
Since release 10.2, this functionality is obsolete and is supported for backward compatibility only. We recommend that you use QAComplete REST API to access and manage data in QAComplete.

Gets a test by its ID and updates its properties with specified values. All unspecified properties are cleared.

Requirements

The user must belong to a security group that has the Update privilege for Test Library.

Parameters

The operation uses the following parameters:

AuthenticationData  :  object, required

An AuthenticationData object containing the login information and the project ID whose test you want to update.

Tests  :  , required

An updated Test object.

SendEMailAlert  :  string, required

Y if you want to send an email alert; N otherwise.

Result

None.

Remarks

The Test object has matching Id and Name properties, for example, FolderId and FolderName. To set them, specify the value only for the Id property. The corresponding Name property will be set automatically.

Example

Sample Code

C#

string login = "[email protected]";
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;

// Prepare the Test object
Test test = new Test();

// Specify the test object to update
int Id = 2;

// Load existing test data
test = service.Tests_Load(authData, Id);

// Specify new values of the test properties
test.AssigneeUserId = 24661;
test.StatusCode = "Approved";
test.Priority = "1-High";

// Update the test
service.Tests_Update(authData, test, "Y");

Java

String login = "[email protected]";
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());

// Prepare the test object
Test test = new Test();

// Specify the test to update
int Id = 2;

// Load existing test data
test = service.testsLoad(authData, Id);

// Specify new values of the test properties
test.setAssigneeUserId(24661);
test.setStatusCode("Approved");
test.setPriority("1-High");

// Update the test
service.testsUpdate(authData, test, "Y");

Sample Request XML

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

<?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>
    <Tests_Update xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </AuthenticationData>
      <Tests>
        <FolderName>Regression Tests</FolderName>
        <AssignedToName>Doe, John</AssignedToName>
        <UserName>Doe, John</UserName>
        <OwnerName>Doe, John</OwnerName>
        <LastRunByName>Doe, John</LastRunByName>
        <TestId>2</TestId>
        <Version>3</Version>
        <ProjId>11873</ProjId>
        <FolderId>12</FolderId>
        <Title>Test input data</Title>
        <IsActive>Y</IsActive>
        <StatusCode>Approved</StatusCode>
        <ExecutionType>Manual</ExecutionType>
        <TestType>Regression</TestType>
        <Priority>1-High</Priority>
        <Description>Test input data</Description>
        <DateCreated>2014-07-17T08:30:28</DateCreated>
        <DateUpdated>2014-07-20T10:53:07</DateUpdated>
        <CreateUserId>24661</CreateUserId>
        <UpdateUserId>24661</UpdateUserId>
        <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</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>
      </Tests>
      <SendEMailAlert>Y</SendEMailAlert>
    </Tests_Update>
  </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: 1892 {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>
    <Tests_Update xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
      </AuthenticationData>
      <Tests>
        <FolderName>Regression Tests</FolderName>
        <AssignedToName>Doe, John</AssignedToName>
        <UserName>Doe, John</UserName>
        <OwnerName>Doe, John</OwnerName>
        <LastRunByName>Doe, John</LastRunByName>
        <TestId>2</TestId>
        <Version>3</Version>
        <ProjId>11873</ProjId>
        <FolderId>12</FolderId>
        <Title>Test input data</Title>
        <IsActive>Y</IsActive>
        <StatusCode>Approved</StatusCode>
        <ExecutionType>Manual</ExecutionType>
        <TestType>Regression</TestType>
        <Priority>1-High</Priority>
        <Description>Test input data</Description>
        <DateCreated>2014-07-17T08:30:28</DateCreated>
        <DateUpdated>2014-07-20T10:53:07</DateUpdated>
        <CreateUserId>24661</CreateUserId>
        <UpdateUserId>24661</UpdateUserId>
        <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</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>
      </Tests>
      <SendEMailAlert>Y</SendEMailAlert>
    </Tests_Update>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 306 {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>
    <Tests_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 316 {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>
    <Tests_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
  </soap12:Body>
</soap12:Envelope>

See Also

Tests_Add
Tests_Delete
Tests_Load
Tests_LoadByCriteria
Test Management Operations
Test Operations
SOAP API Reference

Highlight search results