TestRuns_Update Operation

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

Replaces the test run information with that from the specified TestRun object. Uninitialized properties are cleared.

You usually first call TestRuns_Load to get a test run by ID, change some of its properties and then pass the updated object to TestRuns_Update.

Requirements

The authenticating user must belong to a user group that has the Update privilege for Tests.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object containing the login information and the project ID that contains the test Run.

TestRun  :  TestRun, required

A TestRun object that contains updated information of the test run.

SendEmailAlert  :  string, required

Y means send an email alert to the subscribed users after updating the test run.

Any other value (for example, N or empty string) means do not send email alerts.

Result

None.

Remarks

When you set the StatusCode property, QAComplete can change the statuses of the child TestRunItems objects to the corresponding values.

The TestRun object has matching Id and Name properties, for example, TestSetId and TestSetName. 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 = "john.doe@example.com";
string password = "p@ssword";
int projID = 10372;

// Specifying the test run to update
int ID = 254;

ServiceSoapClient service = new ServiceSoapClient();

// Preparing 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 = projID;

// Loading the test run
TestRun testRun = service.TestRuns_Load(authData, ID);

// Updating the status of the test run
testRun.StatusCode = "Passed";

// Updating the test run
service.TestRuns_Update(authData, testRun, "N");
Console.WriteLine("The test run was updated");

Java

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

// Specifying the test run to update
int ID = 254;

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

// Preparing 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(projID);

// Loading the test run
TestRun testRun = service.testRunsLoad(authData, ID);

// Updating the status of the run
testRun.setStatusCode("Passed");

// Updating the test run
service.testRunsUpdate(authData, testRun, "N");
System.out.format("Test run was updated");

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 1006 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/TestRuns_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>
    <TestRuns_Update xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <TestRun>
        <TestRunId>358</TestRunId>
        <TestSetId>0</TestSetId>
        <TestConfigId>24</TestConfigId>
        <ConfigurationName>Windows 7 (32-bit)</ConfigurationName>
        <ReleaseId>14</ReleaseId>
        <RunByUserName>Doe, John</RunByUserName>
        <IsSequential>N</IsSequential>
        <StatusCode>Passed</StatusCode>
        <ExecutionType>Manual</ExecutionType>
        <DateStarted>2014-07-29T13:24:18:027</DateStarted>
        <DateFinished>2014-07-29T14:14:57:065</DateFinished>
        <ReleaseName>Release 1.0</ReleaseName>
        <TestId>2112</TestId>
        <HostId></HostId>
      </TestRun>
      <SendEmailAlert>N</SendEmailAlert>
    </TestRuns_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: 1014 {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>
    <TestRuns_Update xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <TestRun>
        <TestRunId>358</TestRunId>
        <TestSetId>0</TestSetId>
        <TestConfigId>24</TestConfigId>
        <ConfigurationName>Windows 7 (32-bit)</ConfigurationName>
        <ReleaseId>14</ReleaseId>
        <RunByUserName>Doe, John</RunByUserName>
        <IsSequential>N</IsSequential>
        <StatusCode>Passed</StatusCode>
        <ExecutionType>Manual</ExecutionType>
        <DateStarted>2014-07-29T13:24:18:027</DateStarted>
        <DateFinished>2014-07-29T14:14:57:065</DateFinished>
        <ReleaseName>Release 1.0</ReleaseName>
        <TestId>2112</TestId>
        <HostId></HostId>
      </TestRun>
      <SendEmailAlert>N</SendEmailAlert>
    </TestRuns_Update>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

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

See Also

TestRuns_Add
TestRuns_Load
TestRuns_LoadByCriteria
Test Management Operations
Test Run Operations
SOAP API Reference

Highlight search results