Support for Java Web Start has been removed from Java version 11. |
If you are testing Java Web Start applications (including Oracle Forms running out-of-browser), you may want to add the tested application to the Tested Applications collection of your project.
Adding Java Web Start Applications From the TestComplete IDE
-
If your project does not have the Tested Applications collection, add it:
-
Right-click somewhere within the Tested Apps editor and then click Add Application. This will open the Add Tested Application wizard.
-
On the first page of the wizard, choose Java application.
-
On the next page of the wizard, select Java Web Start application.
-
On the next page of the wizard, specify the launch parameters of the desired Java Web Start application:
-
Select a Java Web Start launcher you want to use to start your application. You can select the desired launcher from the drop-down list, or you can click and browse for the needed launcher manually.
-
Specify the location of the .jnlp file of your Web Start application.
-
-
Click Finish to close the wizard. TestComplete will add the specified Java Web Start application to the list of tested applications and will use the specified parameters when launching it.
Adding Java Web Start Tested Applications From Tests
Instead of adding a tested application to the project manually before running tests, you can add your application to the project’s Tested Applications collection from tests. To do this, you use the TestedApps.AddJavaWebStartApp
method:
The method takes no parameters. It returns the index of the new item added to the Tested Applications collection. You can then use the TestedApps.Items(Index)
property to get the JavaWebStartTestedApp
object corresponding to the added Web Start application.
Use the object’s properties and methods to set the application’s launch parameters and start the application.
The following sample script demonstrates how you can use the TestedApps.AddJavaWebStartApp
method.
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
About Tested Applications
Defining Applications to Test
About TestedApps Editor
Adding Java and JavaFX Applications to the List of Tested Applications