|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tplan.robot.scripting.report.XSLReportProvider
public class XSLReportProvider
Enterprise Report Provider. It is a highly customizable report generator capable of creating reports in XML and HTML formats.
The class works on top of another internal enterprise feature - test result XML generator. It is an object able to create an XML with test results and output objects created by the test script, such as test suites declarations, scripts (test cases), test steps, screenshots, warnings, image comparisons etc.
The report provider takes an advantage of the test result XML to produce a report through an XSL transformation:
.xml extension), the provider
just inserts a link to the XSL file into the test result XML, making it
displayable by any XSL-compliant web browser. As most recent web browsers
support the XML/XSL transformation, the XML report may be then viewed by any
web browser the same way as HTML or parsed by any other third party tool. See
an online Sample XML Report example.
.htm
or .html), the provider performs transformation of the test
result XML using the given XSL file to produce an HTML report.There is a default XSL file bundled with the code which transforms the test result data to the same visual report format as the default HTML provider distributed with the free T-Plan Robot Enterprise version. The file delivers exactly the same functionality and it even uses the same preference values. The added value of the Enterprise Report Provider is that it allows to customize the report through a custom XSL file. This way the report appearance may be radically changed to comply with individual needs.
For example, to change the logo image in the test report perform the following steps:
That's it! The next time you execute a test script with the Report command, it will use your custom XSL template to create the report with your logo. It will also copy the logo image file to the output folder to make it accessible by the report.
The XSL template allows to customize the report in any way. Should you want to learn more about XSL formast and transformations, we suggest you to review the following resources:
wikipedia.org,w3schools.com,Be however aware that XSL transformations are resource intensive. As the report gets refreshed every time the status changes or a new output object is created, it may decrease performance of the whole tool, especially in test scripts with a large number of output objects. Should you experience any delays or low performance, consider one of the following steps:
T-Plan Robot Enterprise, (C) 2009-2013 T-Plan Limited. All rights reserved.
| Field Summary | |
|---|---|
static String |
INTERNAL_XSL_FILE
Name of the internal XSL file. |
static int |
STATUS_CODE_FAIL
|
static int |
STATUS_CODE_PAUSED
|
static int |
STATUS_CODE_RUNNING
|
static int |
STATUS_CODE_STOPPED
|
static int |
STATUS_CODE_SUCCESS
|
static String |
XSL_CONFIG_ATTACH_SCRIPTS
XSL property - attach script configuration flag. |
static String |
XSL_CONFIG_ATTACH_TEMPLATES
XSL property - attach template images configuration flag. |
static String |
XSL_CONFIG_CREATE_COMMENT_TABLE
XSL property - create warning table configuration flag. |
static String |
XSL_CONFIG_CREATE_COMPARISON_TABLE
XSL property - create image comparison table configuration flag. |
static String |
XSL_CONFIG_CREATE_WARNING_TABLE
XSL property - create warning table configuration flag. |
static String |
XSL_CONFIG_DISPLAY_FAILED_COMPARISONS_ONLY
XSL property - create image comparison table configuration flag. |
static String |
XSL_CONFIG_DISPLAY_WARNINGS
XSL property - display warnings in the HTML body configuration flag. |
static String |
XSL_CONFIG_INCLUDE_STEPS_IN_BODY
XSL property - create warning table configuration flag. |
static String |
XSL_PARAM_DURATION_SECONDS
XSL property - number of seconds. |
static String |
XSL_PARAM_DURATION_STRING
XSL property - a string expressing start and end date and duration of automation. |
static String |
XSL_PARAM_LOG_FILE
XSL property - log file. |
static String |
XSL_PARAM_PAUSE_REASON
XSL property - pause reason. |
static String |
XSL_PARAM_STATUS
XSL property - status code. |
| Constructor Summary | |
|---|---|
XSLReportProvider()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Implementation of the ActionListener interface. |
void |
checkDependencies(PluginManager manager)
Check whether the current product installation contains all dependencies (other plugins) required to install this plugin. |
void |
commandEvent(CommandEvent e)
This method is called when a command handler fires an event. |
void |
configurationChanged(ConfigurationChangeEvent evt)
This method gets called when a configuration parameter is changed. |
int |
create(ScriptingContext context,
Map params)
Create a report. |
String |
getCode()
Get plugin code. |
Date |
getDate()
Get plugin release date. |
String |
getDescription()
Get plugin description to be displayed in the GUI. |
String |
getDisplayName()
Get short plugin name to be displayed in the GUI. |
Class |
getImplementedInterface()
Get Class of the exposed functional interface that this plugin implements. |
int[] |
getLowestSupportedVersion()
Get the lowest required version of T-Plan Robot Enterprise. |
String |
getMessageAfterInstall()
Get text of a message to be displayed after installation of this plugin. |
String |
getMessageBeforeInstall()
Get text of a message to be displayed before installation of this plugin. |
List<Preference> |
getPreferences()
Get metadata of displayable/editable configurable parameters. |
String |
getSupportContact()
Get support contact. |
String[] |
getSupportedFormats()
Get formats supported by this particular provider. |
String |
getUniqueId()
Get unique ID associated with the plugin. |
String |
getVendorHomePage()
Get the vendor home page. |
String |
getVendorName()
Get vendor (provider) name to be displayed in the GUI. |
int[] |
getVersion()
Get plugin version in form of an integer array. |
boolean |
isOfflineMode()
|
boolean |
requiresRestart()
Indicate whether installation of this plugin requires application restart. |
void |
scriptEvent(ScriptEvent event)
Gets called when a script event is available. |
void |
setConfiguration(UserConfiguration cfg)
If an object implementing this interface is a plugin (i.e. |
void |
setOfflineMode(boolean offlineMode)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String INTERNAL_XSL_FILE
public static final String XSL_PARAM_DURATION_STRING
public static final String XSL_PARAM_DURATION_SECONDS
public static final String XSL_PARAM_STATUS
public static final String XSL_PARAM_PAUSE_REASON
public static final String XSL_PARAM_LOG_FILE
public static final String XSL_CONFIG_ATTACH_SCRIPTS
public static final String XSL_CONFIG_CREATE_WARNING_TABLE
public static final String XSL_CONFIG_CREATE_COMMENT_TABLE
public static final String XSL_CONFIG_INCLUDE_STEPS_IN_BODY
public static final String XSL_CONFIG_DISPLAY_WARNINGS
public static final String XSL_CONFIG_ATTACH_TEMPLATES
public static final String XSL_CONFIG_CREATE_COMPARISON_TABLE
public static final String XSL_CONFIG_DISPLAY_FAILED_COMPARISONS_ONLY
public static final int STATUS_CODE_RUNNING
public static final int STATUS_CODE_PAUSED
public static final int STATUS_CODE_STOPPED
public static final int STATUS_CODE_FAIL
public static final int STATUS_CODE_SUCCESS
| Constructor Detail |
|---|
public XSLReportProvider()
| Method Detail |
|---|
public String[] getSupportedFormats()
ReportProviderGet formats supported by this particular provider. The formats are not
case sensitive and they must correspond to the supported file extensions.
For example, a provider able to generate XML, HTML and Excel formats should
return new String[] {"xml", "html", "htm", "xls"}.
The method is used by the calling Report instance to validate file name provided by the script command. If the file doesn't have one of the extensions supported by the selected provider, a syntax error is reported.
getSupportedFormats in interface ReportProvider
public int create(ScriptingContext context,
Map params)
create in interface ReportProvidercontext - an execution context.params - Report command argument map.
public void actionPerformed(ActionEvent e)
Implementation of the ActionListener interface.
This method is at present used just by the state update timer which invokes this method at regular intervals. The method then creates a screenshot of the RFB buffer and saves it into a so called state image. A link to this image is then elaborated into the report as a view of the current state.
This class uses its own instance of the ScreenshotCommand class because we don't want the default ScreenshotCommand class to fire all the listeners which would make the report command to re-create the HTML report and even include the state image into the report body.
actionPerformed in interface ActionListenere - an action event.public void scriptEvent(ScriptEvent event)
ScriptListener
scriptEvent in interface ScriptListenerevent - a script event.public void commandEvent(CommandEvent e)
CommandListener
commandEvent in interface CommandListenerpublic void configurationChanged(ConfigurationChangeEvent evt)
ConfigurationChangeListener
configurationChanged in interface ConfigurationChangeListenerevt - A ConfigurationChangeEvent object describing the event source
and the parameter that has changed.public List<Preference> getPreferences()
Configurable
getPreferences in interface Configurablepublic String getCode()
PluginGet plugin code. This string serves as an identifier of the functionality delivered by the plugin. For example, desktop client plugins return protocol name like "RFB" or "RDP" as their code.
Plugin code is used by pluggable instance factories to identify
a particular plugin. It may be used to replace internal plugins with
third party code. For
example if you develop a class which implements this and the
com.tplan.robot.remoteclient.RemoteDesktop interfaces and the
getCode() method returns "RFB", it will replace the internal
implementation of the RFB (VNC) client.
getCode in interface PlugingetCode in interface ReportProviderpublic String getDisplayName()
Plugin
getDisplayName in interface Pluginpublic String getDescription()
Plugin
getDescription in interface Pluginpublic String getVendorName()
Plugin
getVendorName in interface Pluginpublic String getSupportContact()
Plugin
getSupportContact in interface Pluginpublic int[] getVersion()
Pluginnew int[] { 1, 2, 3 }.
getVersion in interface Pluginpublic Class getImplementedInterface()
Plugincom.tplan.robot.remoteclient.RemoteDesktopClient.class.
getImplementedInterface in interface Pluginpublic boolean requiresRestart()
Plugin
requiresRestart in interface Pluginpublic String getVendorHomePage()
Plugin
getVendorHomePage in interface Pluginpublic Date getDate()
Plugin
getDate in interface Pluginpublic String getUniqueId()
PluginGet unique ID associated with the plugin. The plugin manager uses the ID together with the version string to identify whether a plugin is already installed and whether a newer version of the same plugin is available.
The unique ID in fact identifies a particular plugin delivered by a particular vendor. Plugin developers are recommended to choose an ID and keep it constant for all versions of one particular plugin. The ID is never displayed in the GUI so it doesn't have to be a readable text. To avoid conflicts with other vendors it is recommended to elaborate vendor or author name and feature description into the ID, for example "custom RFB client implemented by John Doe".
getUniqueId in interface Pluginpublic int[] getLowestSupportedVersion()
Plugin
getLowestSupportedVersion in interface Pluginpublic String getMessageBeforeInstall()
Plugin
getMessageBeforeInstall in interface Pluginpublic String getMessageAfterInstall()
Plugin
getMessageAfterInstall in interface Plugin
public void checkDependencies(PluginManager manager)
throws DependencyMissingException
PluginDependencyMissingException
if one or more dependencies are missing.
checkDependencies in interface Pluginmanager - shared instance of the plugin manager.
DependencyMissingException - when one or more dependencies requested by this plugin is missing.public void setConfiguration(UserConfiguration cfg)
ConfigurableIf an object implementing this interface is a plugin (i.e. implements also the Plugin interface) and is instantiated through a supported plugin factory, the Plugin Manager calls this method right after an instance of this object is created.
Custom objects which do not already have their configuration parameters in
the default configuration file should take advantage of this method
to store their configuration into the shared User Configuration instance.
It is recommended to call the UserConfiguration.saveConfiguration()
method in the end to save the configuration to the hard drive.
Objects wishing to be notified of changes of configuration parameters
should implement the ConfigurationChangeListener interface and register
with the UserConfiguration instance through the
addConfigurationChangeListener() method.
setConfiguration in interface Configurablecfg - global shared instance of user configuration preloaded with
parameters from the default and user configuration files.public boolean isOfflineMode()
public void setOfflineMode(boolean offlineMode)
offlineMode - the offlineMode to set
|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||