This is an old revision of the document!
TestOptimal Plugins
TestOptimal uses plugin architecture to provide the flexibility for integrating with external test automation framework and tools.
You may also develop your own plugin to extend functionality of TestOptimal or integrate with your proprietary framework/system.
Below are the plugins available:
- Selenium Plugin - test web app with Selenium
- SeqOut Plugin - generate test sequence to text file or Excel
- Appium Plugin - test mobile apps with Appium
- MQTT Plugin - test MQTT-based IoT devies
- REST Plugin - test WebSvc / REST APIs with RestAssured
- Agent Plugin - integrating with external automation
- XUIA Plugin - Keyboard and mouse automation
- Sikuli Plugin - image based UI automation (Beta)
Selenium Plugin
Selenium plugin provides a set of MScript functions to perform test automation on your web application. Just like other plugins, you can enable it for each model and can be used with other plugins together.
Plugin Overview
Selenium plugin uses Selenium to drive your web applications with real browser in real-time as model is executing. You can use either MScript or java to call Selenium to drive your web applications. MScript is an xml-based scripting and Selenium plugin provides a rich set of MScript Functions.
Selenium supports various browsers to test your web applications as well as a simulated browser which offers much higher performance and more suited for running load testing when you need to simulate hundreds or thousands of users running models simultaneously.
Chrome Config & Custom Profile
You can config Google Chrome browser by setting webdriver.properties. You may need to config this plugin using the information provided in the links below:
To set up Chrome browser to use a custom profile, edit webdriver_Selenium.properties and add/update the following setting:
chrome.profile.loc=/path/to/your/custom/profile
For more information about Chrome Driver, please refer to Chrome Driver User Documentation
WebDriver Config
You may also configure Selenium/WebDriver by setting webdriver.properties file. See example webdriver.properties.
By default 32 bit IE driver is used, however you can change this default to 64 bit IE driver by editing webdriver.properties file. Alternatively you can call Selenium function $setCapabilityString() to dynamically change which IE driver to be used to launch AUT:
$Selenium.setCapabilityString('IE.driver','IEDriverServer_64BIT.exe') or $Selenium.setCapabilityString('IE.driver','IEDriverServer_32BIT.exe')
Firefox Custom Profile
This section assumes that you already has created a custom profile using Firefox Profile Manager. If not, following the instruction at How to Create Firefox Profile.
You may use custom Firefox profile by setting firefox.profile.loc in webdriver_Selenium.properties to point to the location/folder where your custom profile is stored:
firefox.profile.loc=C:/path/to/my/filefox/profile
Alternatively you can also set this during model execution in MBT_start trigger:
<action lid="9" code="$Selenium.setCapabilityString('firefox.profile.loc','C:/path/to/my/filefox/profile')"/>
Element Locator
Need help with element locator? Check out these links:
Tools to help find the web element locator:
- Firefox add-on WebDriver Element Locator
SeqOut Plugin
SeqOut Plugin generates the test sequence from your model/MScript to an HTML webpage or Excel document.
The format can be customized by editing the format property file seqout.fmt (see SeqOutFormat) and XSL style sheet seqout.xsl. This plugin may require separate license.
Usage
You must activate SeqOut plugin in ModelNode before running the model. There are two output formats available with this plugin: Excel and Web Page. Select the right plugin format and execute the model.
The output will be generated when the model execution is completed. Please be aware that this plugin does not actually connect to AUT.
One issue you may encounter is that the graph generated for each test case may be too wide to fit in the page, which makes it difficult to print. This can be addressed by changing the graph orientation for the model from Left/Right to Top/Down in Model Property.
You may also double click on the graph to force the graph to resize to fit the entire width of the window.
By default, sequence graph is generated to describe each test case. You may change it to generate Message Sequence Chart (MSC) to describe the test case instead by selecting the corresponding format from the dropdown list field Test Path Graph Type.
Custom Output Format
This plugin serves similar purpose as $seqout('text') and <seqout> tags (see also TestCase Report File), which is used to generate test sequence to be used outside TestOptimal either for documentation purpose or offline testing using external test automation systems. However SeqOut plugin was created to quickly and conveniently generate test sequence from the model/mScript in human readable format for manual testing and documentation.
You may create as many custom formats as you need by creating a set of format property file and XSL style sheet file for each custom format and add them to the list of plugins (see instruction below).
TestOptimal generates the test sequence using the formats defined in format file and saves the output in xml format in report folder. It then calls seqout.xsl (or your custom xsl) transform xml data into the desired format.
Configuration
After the custom format files are created, place them in /MbtSvr/config folder and define them to the system by adding the following row to the Plugins field in Help/Config page:
com.webmbt.plugin.SeqOutPlugin,SeqOutWeb,seqout.fmt,seqout.html,seqout.xsl;
where SeqOutWeb is the plugin id you assign to the format, it is displayed in Plugin field in ModelNode. Note it must starts with SeqOut.
seqout.fmt is the name of the format property file. This file contains formatting rules used by the plugin to generate output for each mScript method.
seqout.html is the name of the output file to store the generated sequences. This argument is optional. If not supplied, the default value of seqout.html is used.
seqout.xsl is the name of XSL style sheet file. This argument is optional. If not supplied, the default value of seqout.xsl is used.
Customization
Do not make changes to the original seqout.fmt or seqout.xsl to avoid your changes being overridden by the software updates. If you need to customize these files, do so on the copy and change the plugin configuration to use the new file.
Output to Excel
The test case is output to Excel workbook document with the following sheets:
- Model - contains model attributes and model execution parmaters
- Requirements - contains list of all requirements covered by the model
- TestCases - contains test cases generated and their steps with associated requirement tags
Appium Plugin
Appium Plugin is used to test web apps and native apps on mobile devices.
Pre-Requisite
Appium Plugin requires Appium be installed on the computer which the mobile devices will be attached or mobile simulators will be installed.
Additionally, you will need Android Studio/SDK to test Android devices and Apple Xcode to test IOS devices.
MQTT Plugin
MQTT Plugin enables testing of MQTT-based IoT devices.
REST Plugin
REST Plugin enables testing of REST and WebSvc using RestAssured.
Agent Plugin
Agent Plugin enables integration with external automation tools and processes through http protocol.
Example remote agent:
WebDriver Plugin
WebDriver Plugin enables testing with products/services implementing WebDriver wire protocol, more info at WebDriver Documentation.
Below is a few examples of such products/services:
XUIA Plugin
XUIA Plugin provides a set of mscript functions for automation using keyboard and mouse.
The automation is accomplished by sending the real keyboard event and mouse movement to AUT. Due to the nature of this type of automation, you must ensure AUT you are automating has the focus just like as if you are testing manually.
SikuliUIA Plugin
Sikuli Plugin provides a set of mscript functions for interacting with any type of UI Applications. Due to the nature of using image to identify the UI control, the performance will be a little bit slower.
UI Images
Sikuli uses images to identify UI controls. The images must be png.
Image files must be stored in /uimap/ subfolder within the model folder.