TestedApps.AddJavaWebStartApp Method

Applies to TestComplete 15.10, last modified on December 15, 2021

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

Description

The AddJavaWebStartApp method allows you to dynamically add a Java Web Start tested application to your test project.

Declaration

TestedApps.AddJavaWebStartApp()

Result Integer

Applies To

The method is applied to the following object:

Result Value

The zero-based index of the Java Web Start application in the TestedApps collection. You can use this index to access the corresponding JavaWebStartTestedApp object by using the TestedApps.Items(Index) property.

Example

The following script adds a Java WebStart application to the TestedApps collection and launches it.

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

Testing Java Applications
Testing Oracle Applications
Adding Java Web Start Applications to the List of Tested Applications

Highlight search results