JavaWebStartTestedApp Object

Applies to TestComplete 15.44, last modified on November 10, 2022

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

Description

The JavaWebStartTestedApp object corresponds to a Java Web Start application (including Oracle Forms applications that run out-of-browser) added to the project’s Tested Applications collection. It lets you access launch parameters of the application, such as the URL of the web page from which the application starts. It also provides methods used to launch and close the tested application from tests.

To obtain the JavaWebStartTestedApp object corresponding to a specific Web Start tested application, use any of the following:

  • TestedApps.AppName, where AppName is the application’s name in the Tested Applications collection and in the Project Explorer.

  • TestedApps.Items(Index), where Index is the zero-based index of the application in the Tested Applications collection.

Members

Example

The following example shows how to add a Web Start application to the Tested Application collection, specify the application's launch parameters and run 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

Testing Java Applications
Testing Oracle Applications
About Tested Applications
Working With Tested Applications in Tests
TestedApps Object

Highlight search results