TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


Web Service / API

Web Service / API is provided to control model execution and retrieve model execution stats/details after the execution from external systems.

Execute Model Service

This websvc will execute model remotely and returns the execution stats after the model execution is completed.

Execute Command


You will see the model execution and when it's completed, it will return a JSON document that contains the execution status like this

You can run the model in ascync mode by setting parameter async=true. This will return a JSON string containing the MBT Session ID, which can then be used to check model execution status or retrieve execution stats.

Execution Parameters

Parameters include:

  • mbtFile or model- name of the model
  • async - true or false, to run model asynchronously (without waiting for the model to finish executing). Default is false.
  • statDesc - description to be saved with the execution stat, this is used to retrieve the stats later for this execution. This is required in order to return the execution stats. If not specified, execution stats will be discard after the execution.
  • mbtMode - sequencer to be used:
    • OptimalSequence
    • RandomSequence
    • GreedySequence
    • MCaseSerial
    • MCaseOptimal
    • ConcurrentSequence
    • PathFinder
    • PriorityPath
  • Stop Condition Settings:
    • stopMinute - number of minutes to allow model to execute, default 60
    • stopTraversal - number of traversals, stop model execute when reached, default 1000
    • stopTransCoveragePct - required transition coverage in percentage, default 100
    • exception - number of exceptions detected, default 100
  • iteration - number of iterations, default 1
  • parallelMode - used with thread set to > 1, default Shared:
    • Shared - multiple threads working to finish the same sequence, use this to achieve model coverage quickly
    • Duplicate - each thread executes the entire test sequence generated independently, use this to simulate multiple users running similar scenarios
  • thread - number of threads, default 1
  • browser - name of the browser to execute the model for web app testing:
    • ie - Internet Explorer
    • firefox - Firefox
    • Chrome - Google Chrome
    • Safari - Safari
    • HtmUnit - simulated browser (no graphical rendering, thus faster)
    • Opera - Opera
  • plugin - plugin ID(s), separate plugin ids with “,”:
    • DATAGEN - DataGen: Utility to generate test data using patterns
    • ALM - ALM: Integration with requirements and defect tracking systems
    • BA - Business Analysis: Build and Animate Prototype from Models
    • SELENIUM - Selenium: Web application cross-browser testing
    • WINUIA - WinUIA: Test Windows UI applications
    • SERVICE - Service: Test database, interfaces and web services
    • REMOTETRIGGER - RemoteTrigger: Integration with external test automation tools
    • REMOTECOMMAND - RemoteCommand: Integration with external test automation tools
    • LOAD - Load - Perform load testing & model orchestration
    • CONCURRENT - Concurrent - Test concurrent & message-driven systems
    • MOBILE - testing mobile apps through Appium
    • WINAPP - testing windows 10 applications
  • seed - random number generator seed, default 123
  • initVar - initialize user variables at the beginning of the model execution
  • uiMapURI - UI Map File
  • appURI - App URI
  • autoClose - close model when model execution completes
  • mcase - name of mCase
  • notifyEmail - email address to send model completion notification, requires javaMail setup

Use RESTful web service to integrated with and manage TestOptimal from your requirements and bug tracking systems.

Retrieve Execution Stats

List Models

To retrieve a list of models and their latest ExecID and execution date: http://localhost:8888/MbtSvr/app=websvc&action=statSvc&cmd=modelList

Open Model

Model Executions

To retrieve a list of model executions for the specified model. If model parameter is not specified, return the model executions for the model currently open: http://localhost:8888/MbtSvr/app=websvc&action=statSvc&cmd=modelExecList&model=Demo_TestGenToFile

To retrieve details of a specific model execution:

Batch Executions

execution_stats_service.txt · Last modified: 2017/12/26 19:39 by admin