This is an old revision of the document!
Writing a Java Handler
Java Handler is a java class containing a set of methods which are called as models are executed to drive AUT.
The easiest way to create the handler class is to let TestOptimal generate a skeleton code for you from your model. To do so, go to Model Property and click on “Generate” link next to “Java Class” field. The generated java code (skeleton code) should be displayed as a text file and you can copy and paste the java code into your favorite java editor, see example java code generated.
All you need to do is implement the appropriate methods with the support of plugin specific methods. Refer to the documentation of the plugin driver:
- Jersey - http://jersey.java.net/
- Selenium - http://www.seleniumhq.org/
We recommend that you use Eclipse or NetBeans to debug and test your java handler. TestOptimal can be integrated with Eclipse and integrated with NetBeans very easily. The java class should be stored at /script/ folder. Please note that if you put your java handler in a package, the java file must be placed in the subfolder under /script/ that reflects the pakage path.