If you are testing Windows Store applications, you may want to add them to the Tested Applications collection in your project.
Adding Windows Store Applications From TestComplete IDE
-
Right-click somewhere within the Tested Apps editor and then click Add Application. TestComplete will open the Add Tested Application wizard.
-
On the first page of the wizard, choose Windows Store application.
-
On the next page of the wizard, the Application package name drop-down list contains the package names of all Windows Store applications installed on your computer. Select the needed package name from the list.
-
If needed, in the Command-line parameters box, enter the command-line options to pass to your Windows Store application.
-
Click Finish to close the wizard. TestComplete will add the specified Windows Store application to the list of tested applications.
Adding Windows Store Applications From Tests
Instead of configuring the Tested Applications collection manually before running tests, you can add your Windows Store application to the Tested Applications collection directly from tests. To do this, use the TestedApps.AddWinStoreApp
method:
The method takes the following parameters:
-
AppName - The name of the application package as it is specified in the application’s package manifest. For example, Microsoft.BingMaps. The application must be installed on your computer.
The method returns the index of the newly added application in the Tested Applications collection.
The example below shows how to add a Windows Store application to the Tested Application collection and run the application.
JavaScript, JScript
function Test()
{
// Adds a Windows Store application to the project
var index = TestedApps.AddWinStoreApp("Microsoft.SDKSamples.Hilo.JS");
var app = TestedApps.Items(index);
// Launches the application
app.Run();
// Tests the application
…
}
Python
def Test():
# Adds a Windows Store application to the project
index = TestedApps.AddWinStoreApp("Microsoft.SDKSamples.Hilo.JS")
app = TestedApps.Items[index]
# Launches the application
app.Run()
# Tests the application
# ...
VBScript
Sub Test
Dim index, app
' Adds a Windows Store application to the project
index = TestedApps.AddWinStoreApp("Microsoft.SDKSamples.Hilo.JS")
Set app = TestedApps.Items(index)
' Launches the application
app.Run
' Tests the application
…
End Sub
DelphiScript
procedure Test;
var index, app;
begin
index := TestedApps.AddWinStoreApp('Microsoft.SDKSamples.Hilo.JS');
app := TestedApps.Items(index);
// Launches the application
app.Run;
// Tests the application
…
end;
C++Script, C#Script
function Test()
{
// Adds a Windows Store application to the project
var index = TestedApps["AddWinStoreApp"]("Microsoft.SDKSamples.Hilo.JS");
var app = TestedApps["Items"](index);
// Launches the application
app["Run"]();
// Tests the application
…
}
See Also
Testing Windows Store Applications
Deploying Windows Store Tested Applications on Test Computers