TestComplete samples (both built-in and additional) are located in the <Users>\Public\Public Documents\TestComplete 14 Samples folder.
Some file managers display the Public Documents folder as Documents.
Description
The DbgServices
object is only available if the DbgServices plugin is installed. This object traces events that occur in tested application and posts them to the test log (see Tracing Events and Exceptions With Debug Services).
To obtain this information, launch the tested application or attach to application's process using one of the object's methods.
For complete information about using the DbgServices
object, see Tracing Events and Exceptions With Debug Services.
Members
Example
TestComplete includes a sample application and a test project that demonstrate how you can use DbgServices
:
Application:
<TestComplete Samples>\Desktop\Running Tested Applications\DbgServices\Application
TestComplete project suites:
<TestComplete Samples>\Desktop\Running Tested Applications\DbgServices
Note: | If you do not have the sample, download the TestComplete Samples installation package from the support.smartbear.com/testcomplete/downloads/samples page of our website and run it. |
The code below launches the first application from the Tested Applications collection and then checks whether the application has started successfully.
JavaScript, JScript
function LaunchTestedApp()
{
var AppIndex = 0;
var Proc = DbgServices.LaunchTestedApplication(AppIndex);
var Res = Proc.Exists;
// Checks whether the application has started successfully
if (Res)
Log.Message("The application has been started successfully.")
else
Log.Message("The application hasn't been started.");
}
Python
def LaunchTestedApp():
AppIndex = 0;
Proc = DbgServices.LaunchTestedApplication(AppIndex)
Res = Proc.Exists
# Checks whether the application has started successfully
if Res:
Log.Message("The application has been started successfully.")
else:
Log.Message("The application hasn't been started.")
VBScript
Sub LaunchTestedApp
AppIndex = 0
Set Proc = DbgServices.LaunchTestedApplication(AppIndex)
Res = Proc.Exists
' Checks whether the application has started successfully
If Res Then
Log.Message("The application has been started successfully.")
Else
Log.Message("The application hasn't been started.")
End If
End Sub
DelphiScript
function LaunchTestedApp;
var Proc, Res, AppIndex;
begin
AppIndex := 0;
Proc := DbgServices.LaunchTestedApplication(AppIndex);
Res := Proc.Exists;
// Checks whether the application has started successfully
if Res then
Log.Message('The application has been started successfully.')
else
Log.Message('The application hasn''t been started.');
end;
C++Script, C#Script
function LaunchTestedApp()
{
var AppIndex = 0;
var Proc = DbgServices["LaunchTestedApplication"](AppIndex);
var Res = Proc["Exists"];
// Checks whether the application has started successfully
if (Res)
Log["Message"]("The application has been started successfully.")
else
Log["Message"]("The application hasn't been started.");
}
See Also
Tracing Events and Exceptions With Debug Services
Default Project Properties
TestedApps Object
TestComplete Helper Objects