AutomationSchedules_LoadTestsByTimeSpan Operation

Applies to QAComplete 14.3, last modified on February 19, 2024
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.

Use the AutomationSchedules_LoadTestsByTimeSpan operation to get automation schedules within the specified time span.

To specify the project to get automation schedules from, use the ProjId value in the AuthenticationData object in the request body.

To get just one automation schedule, use AutomationSchedules_Load. Also, you can use AutomationSchedules_LoadByCriteria to get automation schedules that meet specific conditions.

Requirements

The authenticating user must belong to a user group that has the Read privilege for AutomationSchedules.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object with the login information and the ID of the project that contains the automation schedules.

AutomationType  :  string, required

The automation type of tests which you want to get.

AutomationHostName  :  string, required

The name of the host tests from which you want to get.

StartDate  :  dateTime, required

The start date of the time span tests within which you want to get.

EndDate  :  dateTime, required

The end date of the time span tests within which you want to get.

Result

An array of AutomationSchedule objects that represent automation schedules.

Example

Sample Code

C#

string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;

// Specifying the automation type of the test
string automationType = "TestComplete";
// Specifying the name of the host
string hostName = "Test-WinXPx86";
// Specifying the time span
DateTime startDate = new DateTime(2014, 08, 10);
DateTime endDate = new DateTime(2014, 08, 15);

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 an array of AutomationSchedule objects
AutomationSchedule[] automationSchedules = new AutomationSchedule[0];

// Loading automation schedules
automationSchedules = service.AutomationSchedules_LoadTestsByTimeSpan(authData, automationType, hostName, startDate, endDate);
foreach (AutomationSchedule automationSchedule in automationSchedules)
{
  Console.WriteLine("{0} test is scheduled from {1} to {2} at {3}", automationSchedule.AutomationType, automationSchedule.DateBegin, automationSchedule.DateEnd, automationSchedule.TimeRun);
}

Java

String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;

// Specifying the automation type of the test
String automationType = "TestComplete";
// Specifying the name of the host
String hostName = "Test-WinXPx86";
XMLGregorianCalendar startDate;
XMLGregorianCalendar endDate;

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

ArrayOfAutomationSchedule automationSchedules = new ArrayOfAutomationSchedule();

try
{
  // Specifying the time span
  startDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(2014, 7, 10));
  endDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(2014, 7, 15));
  // Loading automation schedules
  automationSchedules = service.automationSchedulesLoadTestsByTimeSpan(authData, automationType, hostName, startDate, endDate);
  for (AutomationSchedule automationSchedule : automationSchedules.getAutomationSchedule())
  {
    System.out.format("%s test is scheduled from %s to %s at %s%n", automationSchedule.getAutomationType(), automationSchedule.getDateBegin(), automationSchedule.getDateEnd(), automationSchedule.getTimeRun());
  }
}
catch (Exception e)
{
  e.printStackTrace();
}

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 701 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/AutomationSchedules_LoadTestsByTimeSpan"
 

<?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>
    <AutomationSchedules_LoadTestsByTimeSpan xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationType>TestComplete</AutomationType>
      <AutomationHostName>Test-WinXPx86</AutomationHostName>
      <StartDate>2014-08-10T00:00:00</StartDate>
      <EndDate>2014-08-15T00:00:00</EndDate>
    </AutomationSchedules_LoadTestsByTimeSpan>
  </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: 709 {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>
    <AutomationSchedules_LoadTestsByTimeSpan xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <AutomationType>TestComplete</AutomationType>
      <AutomationHostName>Test-WinXPx86</AutomationHostName>
      <StartDate>2014-08-10T00:00:00</StartDate>
      <EndDate>2014-08-15T00:00:00</EndDate>
    </AutomationSchedules_LoadTestsByTimeSpan>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 2537 {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_LoadTestsByTimeSpanResponse xmlns="http://www.pragmaticsw.com/">
      <AutomationTestItems_LoadTestsByTimeSpanResult>
       <AutomationSchedule>
          <AutomationScheduleId>4</AutomationScheduleId>
          <AutomationTestItemId>5</AutomationTestItemId>
          <DateBegin>2014-08-10T00:00:00</DateBegin>
          <DateEnd>2014-08-15T00:00:00</DateEnd>
          <DaysRun>5</DaysRun>
          <TimeRun>10:00 AM</TimeRun>
          <Status>Approved</Status>
          <ProjId>10372</ProjId>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <DateCreated>2014-08-04T21:21:24:067</DateCreated>
          <DateUpdated>2014-08-04T21:21:24:067</DateUpdated>
          <RunASAP>false</RunASAP>
          <TestName>Test input controls</TestName>
          <TestType>pjs</TestType>
          <AutomationType>TestComplete</AutomationType>
          <SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
        </AutomationSchedule>
        <AutomationSchedule>
          <AutomationScheduleId>9</AutomationScheduleId>
          <AutomationTestItemId>8</AutomationTestItemId>
          <DateBegin>2014-08-10T00:00:00</DateBegin>
          <DateEnd>2014-08-15T00:00:00</DateEnd>
          <DaysRun>5</DaysRun>
          <TimeRun>11:00 AM</TimeRun>
          <Status>Pending</Status>
          <ProjId>10372</ProjId>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <DateCreated>2014-08-08T15:48:04:081</DateCreated>
          <DateUpdated>2014-08-08T15:48:04:081</DateUpdated>
          <RunASAP>false</RunASAP>
          <TestName>Test new controls</TestName>
          <TestType>pjs</TestType>
          <AutomationType>TestComplete</AutomationType>
          <SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
        </AutomationSchedule>
      </AutomationTestItems_LoadTestsByTimeSpanResult>
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
    </AutomationTestItems_LoadTestsByTimeSpanResponse>
  </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 2543 {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_LoadTestsByTimeSpanResponse xmlns="http://www.pragmaticsw.com/">
      <AutomationTestItems_LoadTestsByTimeSpanResult>
       <AutomationSchedule>
          <AutomationScheduleId>4</AutomationScheduleId>
          <AutomationTestItemId>5</AutomationTestItemId>
          <DateBegin>2014-08-10T00:00:00</DateBegin>
          <DateEnd>2014-08-15T00:00:00</DateEnd>
          <DaysRun>5</DaysRun>
          <TimeRun>10:00 AM</TimeRun>
          <Status>Approved</Status>
          <ProjId>10372</ProjId>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <DateCreated>2014-08-04T21:21:24:067</DateCreated>
          <DateUpdated>2014-08-04T21:21:24:067</DateUpdated>
          <RunASAP>false</RunASAP>
          <TestName>Test input controls</TestName>
          <TestType>pjs</TestType>
          <AutomationType>TestComplete</AutomationType>
          <SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
        </AutomationSchedule>
        <AutomationSchedule>
          <AutomationScheduleId>9</AutomationScheduleId>
          <AutomationTestItemId>8</AutomationTestItemId>
          <DateBegin>2014-08-10T00:00:00</DateBegin>
          <DateEnd>2014-08-15T00:00:00</DateEnd>
          <DaysRun>5</DaysRun>
          <TimeRun>11:00 AM</TimeRun>
          <Status>Pending</Status>
          <ProjId>10372</ProjId>
          <CreateUserId>24661</CreateUserId>
          <UpdateUserId>24661</UpdateUserId>
          <DateCreated>2014-08-08T15:48:04:081</DateCreated>
          <DateUpdated>2014-08-08T15:48:04:081</DateUpdated>
          <RunASAP>false</RunASAP>
          <TestName>Test new controls</TestName>
          <TestType>pjs</TestType>
          <AutomationType>TestComplete</AutomationType>
          <SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
        </AutomationSchedule>
      </AutomationTestItems_LoadTestsByTimeSpanResult>
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
    </AutomationTestItems_LoadTestsByTimeSpanResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

AutomationSchedules_Add
AutomationSchedules_Delete
AutomationSchedules_IsTestsByTimeSpanExist
AutomationSchedules_Load
AutomationSchedules_LoadByCriteria
AutomationSchedules_Update
Automated Testing Bridge Operations
SOAP API Reference

Highlight search results