This topic relates to the legacy Test Cases screen that provided basic test management functionality and was replaced with Test Management. Starting from release 9.7.0, this functionality is obsolete and is supported only for backward compatibility. |
Replaces the test case information with that from the specified TestCase
object. Uninitialized properties are cleared.
First, you usually call TestCases_Load
to get a test case by ID, change some of its properties, and then pass the updated object to TestCases_Update.
Requirements
The authenticating user must belong to a user group that has the Update privilege for Test Cases.
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 case.
TestCase : TestCase, required
A TestCase
object that represents test case with updated properties.
SendEmailAlert : string, required
Y
means send an email alert to the subscribed users after updating the test case.
Any other value (for example, N
or empty string) means do not send email alerts.
Result
None.
Remarks
The TestCase
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";
int projID = 10372;
// Specifying the test case to update
int ID = 156;
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 case
TestCase testCase = service.TestCases_Load(authData, ID);
// Updating properties of the test case
testCase.StatusCode = "Failed";
testCase.ActualResults = "The offering are not displayed.";
// Updating the test case
service.TestCases_Update(authData, testCase, "N", "Y");
Console.WriteLine("Test case was updated");
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
// Specifying the test case to update
int ID = 13;
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 case
TestCase testCase = service.testCasesLoad(authData, ID);
// Updating properties of the test case
testCase.setStatusCode("Failed");
testCase.setActualResults("The offering are not displayed.");
// Updating the test case
service.testCasesUpdate(authData, testCase, "N", "Y");
System.out.format("Test case 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: 1337 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/TestCases_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>
<TestCases_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<TestCase>
<TestCaseId>156</TestCaseId>
<Title>Test internal text editor</Title>
<StatusCode>Failed</StatusCode>
<Steps>
<![CDATA[<ol><li>Click Tools > Notepad.</li><li>Enter "Test text".</li><li>Close the Notepad dialog.</li></ol>]]>
</Steps>
<ExpectedResults>An offer to save the text must be shown.An offer</ExpectedResults>
<OwnerUserId>27572</OwnerUserId>
<AssigneeUserId>27942</AssigneeUserId>
<PctComplete>100</PctComplete>
<ActHrs>0.2</ActHrs>
<ActualStart>2014-06-10T10:02:26</ActualStart>
<ActFinish>2014-06-10T12:14:21</ActFinish>
<ActualResults>The offering is not displayed.</ActualResults>
<AssignedToName>Doe, John</AssignedToName>
<DateCreated>2014-05-30T14:01:51.057</DateCreated>
<FolderName>FamilyAlbum/Release 1.1/Iteration 1</FolderName>
<OwnerName>Davis, Eugeny</OwnerName>
<ProjId>17823</ProjId>
</TestCase>
<SendEmailAlert>N</SendEmailAlert>
</TestCases_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: 1345 {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>
<TestCases_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<TestCase>
<TestCaseId>156</TestCaseId>
<Title>Test internal text editor</Title>
<StatusCode>Failed</StatusCode>
<Steps>
<![CDATA[<ol><li>Click Tools > Notepad.</li><li>Enter "Test text".</li><li>Close the Notepad dialog.</li></ol>]]>
</Steps>
<ExpectedResults>An offer to save the text must be shown.An offer</ExpectedResults>
<OwnerUserId>27572</OwnerUserId>
<AssigneeUserId>27942</AssigneeUserId>
<PctComplete>100</PctComplete>
<ActHrs>0.2</ActHrs>
<ActualStart>2014-06-10T10:02:26</ActualStart>
<ActFinish>2014-06-10T12:14:21</ActFinish>
<ActualResults>The offering is not displayed.</ActualResults>
<AssignedToName>Doe, John</AssignedToName>
<DateCreated>2014-05-30T14:01:51.057</DateCreated>
<FolderName>FamilyAlbum/Release 1.1/Iteration 1</FolderName>
<OwnerName>Davis, Eugeny</OwnerName>
<ProjId>17823</ProjId>
</TestCase>
<SendEmailAlert>N</SendEmailAlert>
</TestCases_Update>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 310 {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>
<TestCases_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: 320 {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>
<TestCases_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap12:Body>
</soap12:Envelope>
See Also
TestCases_Add
TestCases_Delete
TestCases_Load
TestCases_LoadByCriteria
TestCases_LoadByUNC
Test Cases Operations (Releases 9.6.0 and Earlier)
SOAP API Reference