AutomationTestItems_Add Operation

Applies to QAComplete 12.80 SaaS, last modified on April 20, 2021
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 automation test item to your project and returns the ID of the added item.

Requirements

The authenticating user must belong to a user group that has the Add privilege for Automation Test Items.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

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

AutomationTestItem  :  AutomationTestItem, required

An AutomationTestItem object that contains information about the item that you want to add to the project.

Result

An integer ID of the created automation test item.

Example

Sample Code

C#

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

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;

// Preparing the AutomationTestItem object
AutomationTestItem automationTestItem = new AutomationTestItem();
automationTestItem.AutomationHostId = 1;
automationTestItem.AutomationHostName = "Test-WinXPx86";
automationTestItem.TestName = "Test input controls";
automationTestItem.TestType = "Automation Tests";
automationTestItem.FullPath = "\\\\Test-WinXPx86\\Work\\Tests\\Release\\Project.pjs";
automationTestItem.AutomationType = "TestComplete";

// Adding the automation test item
int Id = service.AutomationTestItems_Add(authData, automationTestItem);
Console.WriteLine("ID of the added item: {0}", Id);

Java

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

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);

// Preparing the AutomationTestItem object
AutomationTestItem automationTestItem = new AutomationTestItem();
automationTestItem.setAutomationHostId(1);
automationTestItem.setAutomationHostName("Test-WinXPx86");
automationTestItem.setTestName("Test input controls");
automationTestItem.setTestType("Automation Tests");
automationTestItem.setFullPath("\\\\Test-WinXPx86\\Work\\Tests\\Release\\Project.pjs");
automationTestItem.setAutomationType("TestComplete");

// Adding the automation test item
int automationTestItemId = service.automationTestItemsAdd(authData, automationTestItem);
System.out.format("The ID of the added item: %d%n", automationTestItemId);

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 889 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/AutomationTestItems_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>
    <AutomationTestItems_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationTestItem>
        <AutomationHostId>1</AutomationHostId>
        <AutomationHostName>Test-WinXPx86</AutomationHostName>
        <TestName>Test input controls</TestName>
        <TestType>Automation Tests</TestType>
        <FullPath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</FullPath>
        <Description>Test input controls and data</Description>
        <AutomationType>TestComplete</AutomationType>
        <ProjId>10372</ProjId>
      </AutomationTestItem>
    </AutomationTestItems_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: 897 {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>
    <AutomationTestItems_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationTestItem>
        <AutomationHostId>1</AutomationHostId>
        <AutomationHostName>Test-WinXPx86</AutomationHostName>
        <TestName>Test input controls</TestName>
        <TestType>Automation Tests</TestType>
        <FullPath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</FullPath>
        <Description>Test input controls and data</Description>
        <AutomationType>TestComplete</AutomationType>
        <ProjId>10372</ProjId>
      </AutomationTestItem>
    </AutomationTestItems_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 1219 {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>
    <AutomationTestItems_AddResponse xmlns="http://www.pragmaticsw.com/">
      <AutomationTestItems_AddResult>5</AutomationTestItems_AddResult>
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationTestItem>
        <AutomationTestItemId>5</AutomationTestItemId>
        <AutomationHostId>1</AutomationHostId>
        <AutomationHostName>Test-WinXPx86</AutomationHostName>
        <TestName>Test input controls</TestName>
        <TestType>Automation Tests</TestType>
        <FullPath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</FullPath>
        <Description>Test input controls and data</Description>
        <AutomationType>TestComplete</AutomationType>
        <ProjId>10372</ProjId>
      </AutomationTestItem>
    </AutomationTestItems_AddResponse>
  </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1227 {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>
    <AutomationTestItems_AddResponse xmlns="http://www.pragmaticsw.com/">
      <AutomationTestItems_AddResult>5</AutomationTestItems_AddResult>
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationTestItem>
        <AutomationTestItemId>5</AutomationTestItemId>
        <AutomationHostId>1</AutomationHostId>
        <AutomationHostName>Test-WinXPx86</AutomationHostName>
        <TestName>Test input controls</TestName>
        <TestType>Automation Tests</TestType>
        <FullPath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</FullPath>
        <Description>Test input controls and data</Description>
        <AutomationType>TestComplete</AutomationType>
        <ProjId>10372</ProjId>
      </AutomationTestItem>
    </AutomationTestItems_AddResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

AutomationTestItems_Delete
AutomationTestItems_Load
AutomationTestItems_LoadByCriteria
AutomationTestItems_LoadByHostName
AutomationTestItems_Update
Automated Testing Bridge Operations
SOAP API Reference

Highlight search results