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_LoadByCriteria
operation to:
-
Get automation schedules that match a specific condition. For example, have a specific automation type or based on a specific automation test item.
-
Get all automation schedules in QAComplete projects (if no condition is specified).
The operation can get schedules from one or several projects. To specify a project to get schedules from, use the ProjId
value in the AuthenticationData
object in the request body. To get schedules from several projects, use the ProjIds
value in the AuthenticationData
object to specify the list of project IDs.
LoadByCriteria
returns results in pages (subsets of data) rather than all at once. Pagination is controlled by the PageSize
and PageNumber
parameters. For information about working with paginated results, see LoadByCriteria Operations.
You can use the Sorting
parameter to sort the automation schedules before returning them from QAComplete.
To get just one item, use AutomationSchedules_Load
. Also, you can use the AutomationSchedules_LoadTestsByTimeSpan
operation to get all automation schedules within the specific time span.
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 (or the list of project IDs) that contains the automation schedules.
Condition : string (max 65536 chars)
An XML-formatted string that describes the automation schedule you want to get. For the syntax and examples, see Condition Syntax.
If you create SOAP requests manually, place the condition string inside CDATA.
To get all automation schedules, use an empty string or a null value.
Sorting : string (max 512 chars)
The order to sort the results before returning them from the web service. For example, by test run ID or number of failed tests. The format is:
Property1 [ASC | DESC ][, Property2 [ASC | DESC ]] [, ...]]]
where property names are those of the AutomationSchedule
object. If you omit ASC or DESC after a property name, test runs are sorted in ascending order.
Example values:
To keep the default sort order, use an empty string or a null value.
PageSize : integer, required
Limits the number of automation schedules to return in one page. Possible values: 1..200.
The last page may have less items than PageSize
. This means the end of the result set.
PageNumber : integer, required
A number starting from 1 that specifies the data page to return in the response. To get all pages, send several requests with increasing PageNumber
values. For example, if PageSize
is 100, PageNumber
of 1 will return items 1..100, PageNumber
of 2 - items 101..200 and so on.
If PageNumber
exceeds the range, an empty array is returned. If PageNumber
is the last page, this page may have less items than PageSize
.
Result
An array of AutomationSchedule
objects that contain information about automation schedules.
Example
Sample Code
This example loads all runs of the specified automation type.
C#
string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;
// Specifying the condition
string condition =
@"<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
Operation='opEQU'>
<Items Type='tField'>
<Value xsi:type='xsd:string'>AutomationType</Value>
</Items>
<Items Type='tString'>
<Value xsi:type='xsd:string'>TestComplete</Value>
</Items>
</Conditions>";
string Sorting = "";
int pageSize = 200;
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;
AutomationSchedule[] automationSchedules = new AutomationSchedule[0];
int pageNumber = 1;
do
{
automationSchedules = service.AutomationSchedules_LoadByCriteria(authData, condition, Sorting, pageSize, pageNumber);
foreach (AutomationSchedule automationSchedule in automationSchedules)
{
Console.WriteLine("{0} test is scheduled from {1} to {2}", automationSchedule.AutomationType, automationSchedule.DateBegin, automationSchedule.DateEnd);
}
} while (automationSchedules.Length == pageSize);
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
// Specifying the desired condition
String condition =
"<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' \n" +
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n" +
" Operation='opEQU'>\n" +
" <Items Type='tField'>\n" +
" <Value xsi:type='xsd:string'>AutomationType</Value>\n" +
" </Items>\n" +
" <Items Type='tString'>\n" +
" <Value xsi:type='xsd:string'>TestComplete</Value>\n" +
" </Items>\n" +
"</Conditions>\n";
int pageSize = 200;
String sorting = "";
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 an array of AutomationSchedule objects
List<AutomationSchedule> automationSchedules;
int pageNumber = 1;
do
{
automationSchedules = service.automationSchedulesLoadByCriteria(authData, condition, sorting, pageSize, pageNumber).getAutomationSchedule();
for (AutomationSchedule automationSchedule : automationSchedules)
{
System.out.format("%s test is scheduled from %s to %s%n", automationSchedule.getAutomationType(), automationSchedule.getDateBegin(), automationSchedule.getDateEnd());
}
pageNumber++;
} while (automationSchedules.size() == pageSize);
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 1059 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/AutomationSchedules_LoadByCriteria"
<?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_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<Condition>
<![CDATA[<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
Operation='opEQU'>
<Items Type='tField'>
<Value xsi:type='xsd:string'>AutomationType</Value>
</Items>
<Items Type='tString'>
<Value xsi:type='xsd:string'>TestComplete</Value>
</Items>
</Conditions>]]>
</Condition>
<Sorting></Sorting>
<PageSize>200</PageSize>
<PageNumber>1</PageNumber>
</AutomationSchedules_LoadByCriteria>
</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: 1067 {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_LoadByCriteria xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<Condition>
<![CDATA[<Conditions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
Operation='opEQU'>
<Items Type='tField'>
<Value xsi:type='xsd:string'>AutomationType</Value>
</Items>
<Items Type='tString'>
<Value xsi:type='xsd:string'>TestComplete</Value>
</Items>
</Conditions>]]>
</Condition>
<Sorting></Sorting>
<PageSize>200</PageSize>
<PageNumber>1</PageNumber>
</AutomationSchedules_LoadByCriteria>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 1730 {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>
<AutomationSchedules_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
<AutomationSchedules_LoadByCriteriaResult>
<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>Pending</Status>
<ProjId>10372</ProjId>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-08-04T21:12:13:024</DateCreated>
<DateUpdated>2014-08-04T21:12:13:024</DateUpdated>
<RunASAP>false</RunASAP>
<TestType>pjs</TestType>
<AutomationType>TestComplete</AutomationType>
<SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
</AutomationSchedule>
<AutomationSchedule>
<AutomationScheduleId>7</AutomationScheduleId>
<AutomationTestItemId>5</AutomationTestItemId>
<DateBegin>2014-08-12T00:00:00</DateBegin>
<DateEnd>2014-08-18T00:00:00</DateEnd>
<DaysRun>7</DaysRun>
<TimeRun>12:00 PM</TimeRun>
<Status>Failed</Status>
<ProjId>10372</ProjId>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-08-07T15:24:38:074</DateCreated>
<DateUpdated>2014-08-07T15:24:38:074</DateUpdated>
<RunASAP>false</RunASAP>
<TestType>pjs</TestType>
<AutomationType>TestComplete</AutomationType>
<SuitePath>\\Test-WinVistax64\Work\Tests\Release\Project.pjs</SuitePath>
</AutomationSchedule>
</AutomationSchedules_LoadByCriteriaResult>
</AutomationSchedules_LoadByCriteriaResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1740 {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>
<AutomationSchedules_LoadByCriteriaResponse xmlns="http://www.pragmaticsw.com/">
<AutomationSchedules_LoadByCriteriaResult>
<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>Pending</Status>
<ProjId>10372</ProjId>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-08-04T21:12:13:024</DateCreated>
<DateUpdated>2014-08-04T21:12:13:024</DateUpdated>
<RunASAP>false</RunASAP>
<TestType>pjs</TestType>
<AutomationType>TestComplete</AutomationType>
<SuitePath>\\Test-WinXPx86\Work\Tests\Release\Project.pjs</SuitePath>
</AutomationSchedule>
<AutomationSchedule>
<AutomationScheduleId>7</AutomationScheduleId>
<AutomationTestItemId>5</AutomationTestItemId>
<DateBegin>2014-08-12T00:00:00</DateBegin>
<DateEnd>2014-08-18T00:00:00</DateEnd>
<DaysRun>7</DaysRun>
<TimeRun>12:00 PM</TimeRun>
<Status>Failed</Status>
<ProjId>10372</ProjId>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-08-07T15:24:38:074</DateCreated>
<DateUpdated>2014-08-07T15:24:38:074</DateUpdated>
<RunASAP>false</RunASAP>
<TestType>pjs</TestType>
<AutomationType>TestComplete</AutomationType>
<SuitePath>\\Test-WinVistax64\Work\Tests\Release\Project.pjs</SuitePath>
</AutomationSchedule>
</AutomationSchedules_LoadByCriteriaResult>
</AutomationSchedules_LoadByCriteriaResponse>
</soap12:Body>
</soap12:Envelope>
See Also
AutomationSchedules_Add
AutomationSchedules_Delete
AutomationSchedules_IsTestsByTimeSpanExist
AutomationSchedules_Load
AutomationSchedules_LoadTestsByTimeSpan
AutomationSchedules_Update
Automated Testing Bridge Operations
SOAP API Reference