Differences

This shows you the differences between two versions of the page.

Link to this comparison view

writeplugin [2016/09/22 02:36]
writeplugin [2016/09/22 02:36] (current)
Line 1: Line 1:
 +===== Writing Custom Plugins =====
  
 +There are two reasons you may want to develop your own plugins: adding custom functions to mScript or extend //​TestOptimal//​ functionality,​ for example to test other types of applications.
 +
 +Add custom function to mScript:
 +
 +  - create a java class by inheriting from an existing plugin which you will be using to run your model: [[http://​testoptimal.com/​javaDoc/​reference/​com/​webmbt/​plugin/​SeleniumPlugin.html|com.webmbt.plugin.SeleniumPlugin]] or [[http://​testoptimal.com/​javaDoc/​reference/​com/​webmbt/​plugin/​HtmlUnitPlugin.html|com.webmbt.HtmlunitPlugin]].
 +  - add your function to the new plugin java class and add the following like right above each of the functions:
 +
 +    @MSCRIPT_METHOD
 +
 +  - all functions must have string parameters, but can return String, String[], int or boolean.
 +  - compile the java class, copy the .class file or .jar file to /build/ folder.
 +  - define the plugin in [[Config|Help/​Config]]
 +  - restart //​TestOptimal//​ server.
 +
 +Create a new plugin (to extend //​TestOptimal//​ functionality):​
 +
 +  - create a java class by inheriting from [[http://​testoptimal.com/​javaDoc/​reference/​com/​webmbt/​plugin/​PluginAncestor.html|com.webmbt.PluginAncestor]].
 +  - implement a few methods required by PluginAncestor class.
 +  - create your own methods you need to drive your application/​process.
 +  - compile and deploy the java class
 +  - define the plugin in [[Config|Help/​Config]]
 +  - restart //​TestOptimal//​ server.
Print/export
QR Code
QR Code writeplugin (generated for current page)