Programming With Java Framework

Explains how to implement a Java Framework test project using Silk Performer.

  1. Add a new Java Framework script to your project. Within Silk Performer, choose File > New > Java Framework Scripts (.bdf/.java).
  2. Enter a name for the Java class, for example Testclass. Then Save the .bdf and .java templates.
  3. Open the Java class by double clicking it in the Project tree menu. Implement the desired Java test code in one or more member functions of the Java class. For example, public void doFoo() throws SilkPerformerException. If you prefer, you can open and modify the Java class in an IDE instead. Note that Java Explorer offers powerful scripting functionality.
  4. Modify the BDF file and make sure that the methods of the Java class are called with correct parameters. Use JavaSet<Datatype> functions to set the function parameters. Use JavaGet<Datatype> functions to retrieve return values.
  5. Open Profile settings and configure a Java Virtual Machine for the test run. If the Java class requires additional Java archives, add them to the classpath. The project directory is added to the classpath automatically and does not have to be configured explicitly.
  6. Invoke a Try Script run. The Java and BDL script will then be compiled automatically.