Location Property

Applies to TestComplete 15.45, last modified on December 01, 2022

Support for Java Web Start has been removed from Java version 11.

Description

Use the Location property to get or set the location of the .jnlp file of your Java Web Start application. It is the same value you specify in the Specify application’s location URL option in the TestedApps editor.

Declaration

JavaWebStartTestedAppObj.Location

Read-Write Property String
JavaWebStartTestedAppObj An expression, variable or parameter that specifies a reference to a JavaWebStartTestedApp object

Applies To

The property is applied to the following object:

Property Value

A string value containing the URL location of the application.

Remarks

If you assign a value to this property, TestComplete will treat your project as modified. So, you will need to save or cancel changes when closing the project. The specified value will be displayed in the TestedApps editor.

Example

The following example adds a new Java Web Start application to a project, specifies its launch parameters and then launches the application:

JavaScript, JScript

function Test()
{
  // Add a Java Web Start application to the project
  var ind = TestedApps.AddJavaWebStartApp();
  var app = TestedApps.Items(ind);

  // Specify Web Start application's launch parameters
  app.JWSLauncher= "C:\\Program Files\\Java\\jre1.8.0\\Bin\\javaws.exe";
  app.Location = "https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp";
  // Launches the Web Start application
  app.Run();
  // Test the application
  …

  app.Close();
}

Python

def Test():
  # Add a Java Web Start application to the project
  ind = TestedApps.AddJavaWebStartApp();
  app = TestedApps.Items(ind);

  # Specify Web Start application's launch parameters
  app.JVMExecutable = "C:\\Program Files\\Java\\jre1.8.0\\Bin\\javaws.exe";
  app.Location = "https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp"
  
  # Launches the Web Start application
  app.Run();
  # Test the application
  # ...

  app.Close();

VBScript

Sub Test
  ' Add a Java Web Start application to the project
  ind = TestedApps.AddJavaWebStartApp
  Set app = TestedApps.Items(ind)

  ' Specify Web Start application's launch parameters
  app.Launcher = "C:\Program Files\Java\jre1.8.0\Bin\javaws.exe"
  app.Location = "https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp"
  ' Launches the Web Start application
  app.Run
  ' Test the application
  …

  app.Close
End Sub

DelphiScript

procedure Test();
var ind, app;
begin
  // Add a Java Web Start application to the project
  ind := TestedApps.AddJavaWebStartApp();
  app := TestedApps.Items(ind);

  // Specify Web Start application's launch parameters
  app.JWSLauncher := 'C:\Program Files\Java\jre1.8.0\Bin\javaws.exe';
  app.Location := 'https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp';
  // Launches the Web Start application
  app.Run;
  // Test the application
  …

  app.Close;
end;

C++Script, C#Script

function Test()
{
  // Add a Java Web Start application to the project
  var ind = TestedApps["AddJavaWebStartApp"]();
  var app = TestedApps["Items"](ind);

  // Specify Web Start application's launch parameters
  app["JWSLauncher"] = "C:\\Program Files\\Java\\jre1.8.0\\Bin\\javaws.exe";
  app["Location"] = "https://docs.oracle.com/javase/tutorialJWS/samples/deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp";
  // Launches the Web Start application
  app["Run"]();
  // Test the application
  …

  app["Close"]();
}

See Also

JavaWebStartTestedApp Object
Testing Java Applications
Testing Oracle Applications
Java Application Parameters
Java Web Start Application Parameters

Highlight search results