This functionality is provided by the automated testing bridge that allows obtaining TestComplete test results to the QAComplete Automation screen. Starting from the release 9.9.0, this functionality is obsolete and is supported only for backward compatibility. |
Adds a new automated test run to your project and returns the ID of the added run.
Requirements
The user must belong to a security group that has the Add privilege for Automation Runs.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData
object containing the login information and the ID of the project to which you want to add a new automated test run.
AutomationRun : AutomationRun, required
An AutomationRun
object that describes the automated test run you want to add to your project.
Result
The ID of the added run.
Remarks
The AutomationRun
object you pass to the method must have the AutomationHostName
, FullTestName
, AutomationType
, StartTime
, and EndTime
properties specified.
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 AutomationRun object
AutomationRun run = new AutomationRun();
run.AutomationHostName = "TestHost-WinXPx86";
run.FullTestName = "Full Regression";
run.AutomationType = "TestComplete";
run.StartTime = new DateTime(2014, 7, 21, 8, 6, 12);
run.EndTime = new DateTime(2014, 7, 21, 8, 6, 48);
run.Status = "Passed";
run.DurationInSecs = 36;
run.NbrTests = 1;
run.NbrPassed = 1;
// Add the run
int runId = service.AutomationRuns_Add(authData, run);
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 AutomationRun object
AutomationRun run = new AutomationRun();
run.setAutomationHostName("TestHost-WinXPx86");
run.setFullTestName("Full Regression");
run.setAutomationType("TestComplete");
run.setStatus("Passed");
try
{
XMLGregorianCalendar startTime;
XMLGregorianCalendar endTime;
startTime = DatatypeFactory.newInstance().newXMLGregorianCalendar("2014-07-21T08:06:12");
endTime = DatatypeFactory.newInstance().newXMLGregorianCalendar("2014-07-21T08:06:48");
}
catch (Exception e)
{
e.printStackTrace();
}
run.setDurationInSecs(36);
run.setNbrTests(1);
run.setNbrPassed(1);
// Add the run
int runId = service.automationRunsAdd(authData, run);
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 1139 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/AutomationRuns_Add"
<?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>
<AutomationRuns_Add xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<AutomationRun>
<AutomationRunId>0</AutomationRunId>
<AutomationTestItemId>0</AutomationTestItemId>
<AutomationHostId>0</AutomationHostId>
<Status>Passed</Status>
<FullTestName>Full Regression</FullTestName>
<NbrTests>1</NbrTests>
<NbrPassed>0</NbrPassed>
<NbrFailed>0</NbrFailed>
<DurationInSecs>36</DurationInSecs>
<AutomationHostName>TestHost-WinXPx86</AutomationHostName>
<StartTime>2014-07-21T08:06:12</StartTime>
<EndTime>2014-07-21T08:06:48</EndTime>
<CreateUserId>0</CreateUserId>
<UpdateUserId>0</UpdateUserId>
<DateCreated>0001-01-01T00:00:00</DateCreated>
<DateUpdated>0001-01-01T00:00:00</DateUpdated>
<AutomationType>TestComplete</AutomationType>
</AutomationRun>
</AutomationRuns_Add>
</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: 1147 {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>
<AutomationRuns_Add xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<AutomationRun>
<AutomationRunId>0</AutomationRunId>
<AutomationTestItemId>0</AutomationTestItemId>
<AutomationHostId>0</AutomationHostId>
<Status>Passed</Status>
<FullTestName>Full Regression</FullTestName>
<NbrTests>1</NbrTests>
<NbrPassed>0</NbrPassed>
<NbrFailed>0</NbrFailed>
<DurationInSecs>36</DurationInSecs>
<AutomationHostName>TestHost-WinXPx86</AutomationHostName>
<StartTime>2014-07-21T08:06:12</StartTime>
<EndTime>2014-07-21T08:06:48</EndTime>
<CreateUserId>0</CreateUserId>
<UpdateUserId>0</UpdateUserId>
<DateCreated>0001-01-01T00:00:00</DateCreated>
<DateUpdated>0001-01-01T00:00:00</DateUpdated>
<AutomationType>TestComplete</AutomationType>
</AutomationRun>
</AutomationRuns_Add>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 393 {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>
<AutomationRuns_AddResponse xmlns="http://www.pragmaticsw.com/">
<AutomationRuns_AddResult>1</AutomationRuns_AddResult>
</AutomationRuns_AddResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 403 {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>
<AutomationRuns_AddResponse xmlns="http://www.pragmaticsw.com/">
<AutomationRuns_AddResult>1</AutomationRuns_AddResult>
</AutomationRuns_AddResponse>
</soap12:Body>
</soap12:Envelope>
See Also
AutomationRuns_Delete
AutomationRuns_Load
AutomationRuns_LoadByCriteria
AutomationRuns_Update
Automated Testing Bridge Operations
SOAP API Reference