StartupLink Property

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

The StartupLink property lets you get or set the location of the application's deployment manifest (.application) or shortcut (.appref-ms) used to launch the tested ClickOnce application. This is the same value as the one specified in the Startup link parameter in the TestedApps editor.

Declaration

ProgObj.StartupLink

Read-Write Property String
ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

Property Value

A string that holds one of the following values:

  • The URL of the application's deployment manifest (.application). For example:

    http://www.example.com/myapp/MyApp.application

    http://server/myapp/MyApp.application

    If the ClickOnce application uses parameters, they are included in the URL query string. For example:

    http://www.example.com/myapp/MyApp.application?param1=value1&param2=value2

  • The fully-qualified file name of the ClickOnce application's deployment manifest (.application) on the local computer or on a network share. For example:

    C:\MyApp\MyApp.application

    \\server\shared\MyApp.application

  • The fully-qualified name of the shortcut (.appref-ms) that refers to the installed ClickOnce application. For example:

    C:\MyApp.appref-ms

Remarks

  • You can use environment variables in the file paths. For example:

    %USERPROFILE%\Desktop\MyApp.appref-ms

    %APPDATA%\Microsoft\Windows\Start Menu\Programs\MyCompany\MyApp.appref-ms

  • ClickOnce .appref-ms shortcuts are typically created in the Start menu and on the desktop. However, the Start menu and desktop paths are user- and operating system-specific. If you are going to run the test on multiple computers, we recommend copying the .appref-ms shortcut to a folder that is common for all computers, for example, a network share (see Avoiding Computer-Specific Settings). Alternatively, you can specify the application by its .application manifest.

Example

The following example adds a new ClickOnce application to the Tested Applications collection and then posts its properties to the test log:

JavaScript, JScript

function Test()
{
  var index = TestedApps.AddClickOnceApp("http://www.example.com/MyApp/MyApp.application", "MyApp.exe");
  var app = TestedApps.Items(index);

  Log.Message(app.StartupLink);
  Log.Message(app.ProcessToWait);
}

Python

def Test():
  index = TestedApps.AddClickOnceApp("http://www.example.com/MyApp/MyApp.application", "MyApp.exe")
  app = TestedApps.Items[index]
  Log.Message(app.StartupLink)
  Log.Message(app.ProcessToWait)

VBScript

Sub Test
  Dim index, app

  index = TestedApps.AddClickOnceApp("http://www.example.com/MyApp/MyApp.application", "MyApp.exe")
  Set app = TestedApps.Items(index)

  Log.Message app.StartupLink
  Log.Message app.ProcessToWait
End Sub

DelphiScript

procedure Test;
var index, app;
begin
  index := TestedApps.AddClickOnceApp('http://www.example.com/MyApp/MyApp.application', 'MyApp.exe');
  app := TestedApps.Items(index);

  Log.Message(app.StartupLink);
  Log.Message(app.ProcessToWait);
end;

C++Script, C#Script

function Test()
{
  var index = TestedApps["AddClickOnceApp"]("http://www.example.com/MyApp/MyApp.application", "MyApp.exe");
  var app = TestedApps["Items"](index);

  Log["Message"](app["StartupLink"]);
  Log["Message"](app["ProcessToWait"]);
}

See Also

Testing ClickOnce Applications
ProcessToWait Property
WaitTimeout Property

Highlight search results