EntryPoint Property

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

Description

The EntryPoint property specifies the name of the tested application’s main class, which is its entry point (this class contains the main procedure). You need to specify this value if your tested Java application is a .class or .jar file with no startup class defined. To specify the path to the application’s file (.jar or .class) that contains the main class, use the JavaTestedApp.ClassPaths property.

The EntryPoint property specifies the same value as the Specify application’s entry point property in the TestedApps editor.

Declaration

JavaTestedAppObj.EntryPoint

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

Applies To

The property is applied to the following object:

Property Value

A string value containing the name of the class of the tested application to be invoked.

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 application to a project, specifies its launch parameters and then launches the application:

JavaScript, JScript

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

  // Specify Java application's launch parameters
  app.RunAsJar = false;
  app.JVMExecutable = "C:\\Program Files\\Java\\jre7\\Bin\\java.exe";
  app.EntryPoint = "com.automatedqa.testcomplete.OrdersApp";
  app.ClassPaths = "C:\\JavaApps\\SampleApp.jar" + "\r\n" + "C:\\JavaApps\\CustomClasses\\";
  app.Options = "-verbose:class";

  // Launches the Java application
  app.Run();
  // Test the application
  …

  app.Close();
}

Python

def Test():
  # Add a Java application to the project
  ind = TestedApps.AddJavaApp()
  app = TestedApps.Items[ind]
  # Specify Java application's launch parameters
  app.RunAsJar = False
  app.JVMExecutable = "C:\\Program Files\\Java\\jre7\\Bin\\java.exe"
  app.EntryPoint = "com.automatedqa.testcomplete.OrdersApp"
  app.ClassPaths = "C:\\JavaApps\\SampleApp.jar" + "\r\n" + "C:\\JavaApps\\CustomClasses\\"
  app.Options = "-verbose:class"
  # Launches the Java application
  app.Run();
  # Test the application
  # ...
  # app.Close()

VBScript

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

  ' Specify Java application's launch parameters
  app.RunAsJar = false
  app.JVMExecutable = "C:\Program Files\Java\jre7\Bin\java.exe"
  app.EntryPoint = "com.automatedqa.testcomplete.OrdersApp"
  app.ClassPaths = "C:\JavaApps\SampleApp.jar" + vbCrLf + "C:\JavaApps\CustomClasses\"
  app.Options = "-verbose:class"

  ' Launches the Java application
  app.Run
  ' Test the application
  …

  app.Close
End Sub

DelphiScript

procedure Test();
var
  ind : integer;
  app : OleVariant;
begin
  // Add a Java application to the project
  ind := TestedApps.AddJavaApp();
  app := TestedApps.Items(ind);

  // Specify Java application's launch parameters
  app.RunAsJar := false;
  app.JVMExecutable := 'C:\Program Files\Java\jre7\Bin\java.exe';
  app.EntryPoint := 'com.automatedqa.testcomplete.OrdersApp';
  app.ClassPaths := 'C:\\JavaApps\\SampleApp.jar' + #10#13 + 'C:\JavaApps\CustomClasses\';
  app.Options := '-verbose:class';

  // Launches the Java application
  app.Run;
  // Test the application
  …

  app.Close;
end;

C++Script, C#Script

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

  // Specify Java application's launch parameters
  app["RunAsJar"] = false;
  app["JVMExecutable"] = "C:\\Program Files\\Java\\jre7\\Bin\\java.exe";
  app["EntryPoint"] = "com.automatedqa.testcomplete.OrdersApp";
  app["ClassPaths"] = "C:\\JavaApps\\SampleApp.jar" + "\r\n" + "C:\\JavaApps\\CustomClasses\\";
  app["Options"] = "-verbose:class";

  // Launches the Java application
  app["Run"]();
  // Test the application
  …

  app["Close"]();
}

See Also

JavaTestedApp Object
Testing Java Applications
Java Application Parameters
ClassPaths Property

Highlight search results