Replaces the information on the test run item with that from the specified TestRunItem
object. Uninitialized properties are cleared.
You usually first call TestRunItems_Load
to get a test run item by ID, change some of its properties, and then pass the updated object to TestRunItems_Update
.
Requirements
The authenticating user must belong to a user group that has the Update privilege for Test Library.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData
object containing the login information and the project ID that contains the related test.
TestRunItem : TestRunItem, required
A TestRunItem
object that contains updated information of the item.
SendEmailAlert : string, required
Y
means send an email alert to the subscribed users after updating the test run item.
Any other value (for example, N
or empty string) means do not send email alerts.
Result
None.
Remarks
Do not specify the following properties; they are set automatically:
-
Version
,IsStoppedOnFail
,TestName
– are set to the corresponding values of the related test. -
DateFinished
are set to the current date and time (when the status is Failed, Passed, or Blocked) or to the default date0001-01-01T00:00:00
(when the status is Awaiting Run or Skipped). -
IsStoppedOnFail
,RunByUserName
,ReleaseName
,ConfigurationName
,TestSetName
– are set to the corresponding values of the parent test set. -
AvgRunTime
andAvgRunTimeFormated
are set to the correct value.
When the status of the parent TestRun
object is changed, QAComplete changes the Awaiting Run status of TestRunItem
to the corresponding value.
The TestRunItem
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 = "[email protected]";
string password = "p@ssword";
int projID = 10372;
// Specifying the test run item to update
int ID = 1354;
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 item
TestRunItem testRunItem = service.TestRunItems_Load(authData, ID);
// Updating the status of the item
testRunItem.StatusCode = "Blocked";
// Updating the item
service.TestRunItems_Update(authData, testRunItem, "N");
Console.WriteLine("The test run item was updated");
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
// Specifying the test run item to update
int ID = 1354;
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 item
TestRunItem testRunItem = service.testRunItemsLoad(authData, ID);
// Updating the status of the item
testRunItem.setStatusCode("Blocked");
// Updating the item
service.testRunItemsUpdate(authData, testRunItem, "N");
System.out.format("Test run item 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: 893 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/TestRunItems_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>
<TestRunItems_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<TestRunItem>
<TestRunItemId>1354</TestRunItemId>
<TestSetId>254</TestSetId>
<TestId>468</TestId>
<Seq>1</Seq>
<DateStarted>2014-07-29T13:24:18:027</DateStarted>
<DateFinished>2014-07-29T13:26:31:069</DateFinished>
<RunTime>134</RunTime>
<IsStoppedOnFail>N</IsStoppedOnFail>
<RunByUserName>Doe, John</RunByUserName>
<ConfigurationName>Windows 7 (32-bit)</ConfigurationName>
</TestRunItem>
<SendEmailAlert>N</SendEmailAlert>
</TestRunItems_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: 901 {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>
<TestRunItems_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<TestRunItem>
<TestRunItemId>1354</TestRunItemId>
<TestSetId>254</TestSetId>
<TestId>468</TestId>
<Seq>1</Seq>
<DateStarted>2014-07-29T13:24:18:027</DateStarted>
<DateFinished>2014-07-29T13:26:31:069</DateFinished>
<RunTime>134</RunTime>
<IsStoppedOnFail>N</IsStoppedOnFail>
<RunByUserName>Doe, John</RunByUserName>
<ConfigurationName>Windows 7 (32-bit)</ConfigurationName>
</TestRunItem>
<SendEmailAlert>N</SendEmailAlert>
</TestRunItems_Update>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 313 {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>
<TestRunItems_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: 323 {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>
<TestRunItems_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap12:Body>
</soap12:Envelope>
See Also
TestRunItems_Load
TestRunItems_LoadByCriteria
Test Management Operations
Test Run Item Operations
SOAP API Reference