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

Link to this comparison view

mscripttags [2016/09/22 02:36] (current)
Line 1: Line 1:
 +===== MScript - XML Based Scripting=====
 +//MScript// is an XML based scripting to either directly drive your application under test (AUT) or generate testing script to be executed or read later for offline testing in any programming language syntax.
 +==== MScript Tags ====
 +  * [[actionTag|action]] - executes the action specified in the //code// attribute, e.g. to click the button named //Order//, you would enter //​code="​click('​name=Order'​)"//​. See [[mScriptFunc|mScript function]]. You may also create your own [[User Defined Functions]].
 +  * [[assertTag|assert]] - asserts the condition specified. if condition fails throw the MBTException.
 +  * [[commentsTag|comments]] - comments for any mScript tags. Also see //comment// attribute for all tags.
 +  * [[datasetTag|dataset]] - defines a dataset. Its body contains tags that populates the dataset.
 +  * [[dbTag|db]] - defines a jdbc data source to be used by [[sqlTag|sql tag]].
 +  * [[execSQL Tag|execSQL]] - executes an sql statement.
 +  * [[fieldTag|field]] - defines a field in a row and sets its value.
 +  * [[guardTag|guard]] - defines a constraint for the conditional transition/​edge
 +  * [[ifTag|if]] - performs condition check and if evaluates to true then execute the command tags in the body.
 +  * [[logTag|log]] - logs a message to //​TestOptimal//​ server log file.
 +  * [[mbtTag|mbt]] - container tag to hold one or many [[scriptTag|scripts]] to control MBT execution.
 +  * [[rowdataTag|rowdata]] - adds a row to the data set. Must be within a dataset tag and contain at least one field tag.
 +  * [[scriptTag|script]] - defines a script method to be executed at state entry/exit or transition prep, action or verify. The body of the script tag is the command tags. This tag is equivalent to the method declaration in a java class.
 +  * [[Tag scriptlet|scriptlet]] - executes a list of [[http://​seleniumhq.org/​docs/​02_selenium_ide.html|Selenium IDE Script]] (copy //tbody// content from [[http://​seleniumhq.org/​docs/​02_selenium_ide.html|Selenium IDE]]).
 +  * [[Tag seqout|seqout]] - writes to seq.out. use this tag to create the test script/code to be read or executed in other test automation tool. (Release 3.0)
 +  * [[sqlTag|sql]] - declares the sql statement to populate [[datasetTag|dataset]].
 +  * [[stateTag|state]] - container tag to hold [[scriptTag|scripts]] for a state including [[transitionTag|transition]].
 +  * [[transitionTag|transition]] - container tag to hold [[scriptTag|scripts]] for a transition.
 +  * [[whileTag|while]] - executes the script in its body if the condition specified is true.
 +==== Commenting MScript ====
 +There are two ways you can comment your MScript: as an attribute //comment// for short comments or as a separate child tag //​comments//​ for multi line comments.
 +==== Variables ====
 +//MScript// supports two types of variables: [[System Variables|system variables]] and [[User Variables|user variables]]. ​
 +Both types of variables can be retrieved using a concise form: [varName].
 +For example:
 +  * [curStateID] - equivalent to $getSysVar('​curStateID'​)
 +  * [var1] - equivalent to $getVar('​var1'​)
 +==== Macro Tokens ====
 +Besides //user variables//,​ you may define a set of macro to be used to construct dynamic content. You can then reference these tokens with [@tokenName],​ for example:
 +  [@copyRightText]
 +  ​
 +The macro tokens are defined in //​token.properties//​ in //config// folder. ​ It is a java properties file with format of //​code=value//​.
QR Code
QR Code mscripttags (generated for current page)