Documentation › MXML Tag Reference (Complete)
MXML Tag Reference
This is the exhaustive catalog — every tag in every namespace, generated directly from the authoritative XSD schemas. For a narrative, task-oriented walkthrough of the language, see the MXML Language Reference.
MXML (MaxTAF XML) is MaxTAF's XML test-automation language. A test file is a <testCase> containing tests, methods and activities (tags). Tags come from several XML namespaces; the core control-flow tags are unprefixed, the rest use a namespace prefix (ui:, db:, net:, sys:, time:, perf:).
Generated from the authoritative schema files
maxtaf.xsdandui.xsd(and the schemas they import:db.xsd,net.xsd,system.xsd,time.xsd,perf.xsd,tag.xsd) inmaxtaf-storage/src/main/resources/mxml/xml-xsd/. Descriptions and most examples are taken directly from the schema documentation; examples marked (synthesised) are skeletons built from the tag's attributes.
Namespaces
| Prefix | Namespace URI | Schema | Purpose |
|---|---|---|---|
| (none) | http://www.maxtaf.com | maxtaf.xsd | Core structure, flow control, variables, assertions |
ui: |
http://www.maxtaf.com/ui | ui.xsd | Web UI / Selenium automation |
db: |
http://www.maxtaf.com/db | db.xsd | JDBC database access |
net: |
http://www.maxtaf.com/net | net.xsd | Network / HTTP checks |
sys: |
http://www.maxtaf.com/system | system.xsd | Run orchestration & parameters |
time: |
http://www.maxtaf.com/time | time.xsd | Stopwatches & date-time |
perf: |
http://www.maxtaf.com/perf | perf.xsd | Performance segments |
tag: |
http://www.maxtaf.com/schema/tag | tag.xsd | Meta-schema for defining custom tags |
Anatomy of a test case
Every MXML file is a <testCase> with optional lifecycle blocks and one or more <test> blocks. A typical UI test looks like this:
<testCase name="MyTest" xmlns="http://www.maxtaf.com" xmlns:ui="http://www.maxtaf.com/ui">
<beforeTestCase>
<initializeApi />
<ui:createDriver><ui:timeout>20</ui:timeout></ui:createDriver>
<ui:javaScriptExecutor />
<addReporter type="xml" name="My Test" />
</beforeTestCase>
<test name="testMyTest">
<addTestReport name="testMyTest" />
<ui:maximizeWindow />
<!-- activities (tags) go here -->
<ui:click><ui:id>saveButton</ui:id></ui:click>
<ui:assertValue value="APPR"><ui:id>status</ui:id></ui:assertValue>
<testReportStatus>PASSED</testReportStatus>
</test>
<afterTestCase>
<ui:close />
<closeReporter />
</afterTestCase>
</testCase>
Core / Control-Flow Tags
Structure, flow control, variables, assertions and reporting. Used without a namespace prefix (they belong to the default MXML namespace).
<testCase>
Root element of MXML. Test case is the collection of all related tests into one logical group.
| Attribute | Required | Description |
|---|---|---|
id |
no | ID of the testCase. |
name |
yes | Name of the test case. Must be the same as the name of the file to which this test case is saved. |
Child elements: <imports>, <globals>, <var>, <set>, <include>, <afterTestCase>, <afterTest>, <test>, <method>, <beforeTestCase>, <beforeTest>
Example:
<testCase name="WOAPPRTest" xmlns="http://www.maxtaf.com" xmlns:mif="http://www.maxtaf.com/mif">
<return>
Defines the return value of a method. The type of the returned value must match the type of method's 'type' attribute</var>
| Attribute | Required | Description |
|---|---|---|
expression |
no | Java expression which value will be returned by the method. |
Example (synthesised):
<return expression="..." />
<var>
Defines a new test variable. The value of the variable is set to the element's value. The type of the variable is one of the valid Java types.
Text content: tns:nonEmptyString
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the variable. The name must follow Java naming convention. |
type |
yes | Type of the variable. This must be a valid Java type. Common examples: Strings -> String Whole numbers -> int Decimal numbers -> Decimal |
Example:
<var type="String" name="orgId">"EAGLENA"</var>
<set>
Assigns a value to a variable. The content of this element is an expression. The resulting value of this expression is assigned to the variable named in the "variable" attribute. Note: the resulting type of the expression must be compatible with the type of the variable, otherwise you will get a type mismatch.
Text content: tns:nonEmptyString
| Attribute | Required | Description |
|---|---|---|
variable |
yes | Name of the variable. |
Example:
<test name="setFixedString">
<var name="myString" type="String">""</var>
<set variable="myString">"ABC"</set>
<assertTrue condition='myString.equals("ABC")'/>
</test>
<test name="setExpressionString">
<var name="myString" type="String">""</var>
<var name="yourString" type="String">"ABC"</var>
<set variable="myString">yourString + "XYZ"</set>
<assertTrue condition='myString.equals("ABCXYZ")'/>
</test>
<test name="setExpressionInt">
<var name="myInt" type="int">0</var>
<var name="yourInt" type="int">10</var>
<var name="herInt" type="int">4</var>
<set variable="myInt">yourInt + 20 / herInt</set>
<assertTrue condition='myInt==15'/>
</test>
<include>
Use this tag when you want to insert a segment of MXML script into your test case. Typically, when the same MXML set of tags is repeated between many different test cases, you can save that segment in a file and then put the "include" tag in your scripts instead of repeating the same code over and over. This approach lets you maintain this common code in one file only.
| Attribute | Required | Description |
|---|---|---|
path |
yes | Path to a XML file to include. |
Example:
<test name='testWOreportActuals'>
<addTestReport name="testDuke"/>
<ui:maximizeWindow />
<!-- include the xml that has all the clicks and types to create and approve a standard corrective work order -->
<include path="C:\\ibm\\SMP\\maximo\\maxtaf\\script\\create_approve_wo.xml" />
<!-- work order is now cretaed and approved and we are on the Main tab. Now switch to the 'Actuals' tab and report actuals -->
<!-- [ click ] tab - Actuals -->
<ui:click>
<ui:xpath>//a[@staticId='actuals-tab_tab_anchor']</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//div[@staticId='clientarea-clientarea_clientarea']</ui:xpath>
</ui:click>
<!-- [ click ] pushbutton -->
<ui:click>
<ui:xpath>//button[@staticId='actuals_actuals_aclabor_aclabor_table_2_3-pushbutton_pushbutton']</ui:xpath>
</ui:click>
</testCase>
The content of the include
<segment xmlns:ui="http://www.maxtaf.com/ui">
<ui:click>
<ui:xpath>//img[@staticId='toolactions_button_0-toolbarbutton_image_image']</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//img[@staticId='toolactions_button_1-toolbarbutton_image_image']</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//img[@staticId='toolactions_button_14-toolbarbutton_image_image']</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//button[@staticId='changestatus_2_1-pushbutton_pushbutton']</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//span[@staticId='gotolink-gotolink_link1']/span/span[3]</ui:xpath>
</ui:click>
<ui:click>
<ui:xpath>//span[@staticId='gotolink-gotolink_link1']/span/span[3]</ui:xpath>
</ui:click>
</segment>
Note that the included xml file WILL NOT pass through the XSD validation. The invalid xml content will be ignored by the compiler. It is up to the developer of that xml file to make sure that the content is valid.
<printOut>
Prints out element's content to the System or SystemErr log. Used in printOut and printErr tags. <printOut> tag will output to System log, <printErr> will output to SystemErr log.
Text content: xsd:string
| Attribute | Required | Description |
|---|---|---|
out |
no | — |
Example:
<printOut>"Company master name is "+compMasterName</printOut>
<printErr>"There is no work order with num: "+wonum</printErr>
<endTest>
Unconditionally ends the test.
Example:
<addTestReport name="endTestReport" />
<var name="a" type="int">1</var>
<if condition="a==1">
<endTest />
</if>
<addReportLine action="ifPassed" expected="this line will never execute as the test has been previously ended" actual="" status="PASSED" />
<printErr>
Prints out element's content to the System or SystemErr log. Used in printOut and printErr tags. <printOut> tag will output to System log, <printErr> will output to SystemErr log.
Text content: xsd:string
| Attribute | Required | Description |
|---|---|---|
out |
no | — |
Example:
<printOut>"Company master name is "+compMasterName</printOut>
<printErr>"There is no work order with num: "+wonum</printErr>
<isAdminModeOn>
Checks if Maximo Admin mode is ON.
Text content: xsd:string
Example (synthesised):
<isAdminModeOn>value</isAdminModeOn>
<isAdminModeOff>
Checks if Maximo Admin mode is OFF.
Text content: xsd:string
Example (synthesised):
<isAdminModeOff>value</isAdminModeOff>
<addTestReport>
Adds a new test report to the reporter. Located within the "test " tag and before any "addReportLine" tags. Since a MaxTAF test case can contain more than one MXML test tags, we can add several reports.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the Report. |
Example:
<addTestReport name="createCompanyMaster" />
<apiInput>
Used for exchanging values between test cases in a suite. Takes on the value of the "apiOutput" tag from the preceding test case in a test suite and assigns it to the variable specified in the "var" attribute.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Name of the variable that will be assigned the value of the apiInput. |
Example:
1) The first test case fills the apiOutput variable with the newly created Work Order number:
...
<apiOutput var="newWoNum"/>
...
2) The subsequent test receives the wonum through "apiInput" mechanism and puts it in the woNum variable for later use:
...
<var type="String" name="woNum">null</var>
<apiInput var="woNum"/>
....
<apiOutput>
Used for exchanging values between test cases in a suite. Takes the value of the variable specified in the "var" attribute and passes it on to the next test case in the test suite.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Name of the variable that will be assigned the value of the apiInput. |
Example:
1) The first test case fills the apiOutput variable with the newly created Work Order number:
...
<apiOutput var="newWoNum"/>
...
2) The subsequent test receives the wonum through "apiInput" mechanism and puts it in the woNum variable for later use:
...
<var type="String" name="woNum">null</var>
<apiInput var="woNum"/>
....
<addReportLine>
Adds a report line to the test report.
| Attribute | Required | Description |
|---|---|---|
action |
no | Describes the test action, e.g. "Approve Work Order". |
expected |
no | Describes the expected outcome of the action. E.g. "Work Order Approved". |
actual |
no | States the actual outcome. E.g. "Work Order not approved." |
status |
no | Status of the this test action. Normally it is "PASSED" or "FAILED". |
Example:
<addReportLine action="$titleText" expected="Company Master application is opened" actual="Company Master application is opened" status="PASSED" />
<addReporter>
Sets-up the test Reporter. The test Reporter is a mechanism in Maxtaf that produces the output run report. It must be located within the "beforeTestCase" tag.
| Attribute | Required | Description |
|---|---|---|
type |
yes | Type of the report. at present, MaxTAF supports "xml" and "simple" types. The "xml" type produces an xml output file. During the display of the report in MaxTAF, this xml file is linked with a style sheet that transforms it to an html page. The default style sheet is supplied with MaxTAF but the userProject can customize it to achieve a custom appearance. This type of report prints it's attributes (name, description,..) in the header of the report. The "simple" type produces a plain text output |
name |
yes | Name of the reporter. |
description |
yes | Description. |
class |
no | The name of the Junit class of the MaxTAF test. |
author |
no | Author of the test. |
Example:
<addReporter type="xml" name="Create Company Master" description="Testing Company Master application functionality" class="rs.cdl.maxtaf.test.CompanyMasterTestUI" author="John" />
<initializeApi>
Initializes system service. The system service enables the test code to exchange data with the framework.
Example:
<initializeApi/>
<afterTestCase>
Contains any processing that is required to be executed after the test case is completed.
Child elements: <closeReporter>, <close>
Example (synthesised):
<afterTestCase>
<closeReporter>...</closeReporter>
<close>...</close>
</afterTestCase>
<closeReporter>
(no description in schema)
Text content: xsd:string
Example (synthesised):
<closeReporter>value</closeReporter>
<afterTest>
Contains any processing that is required to be executed after a <test> tag is completed.
There can only be one afterTest tag in a MaxTAF test case, and the processing within the tag will be executed/repeated after the completion of any of the test tags in the test case.
Child elements: <closeReporter>, <close>
Example:
<afterTest>
<mif:removeListener/>
</afterTest>
<beforeTestCase>
Executes the content of this element before the test case. Content of this element can be used to prepare the test case environment (e.g. add a reporter).
Example:
<beforeTestCase>
<ui:createDriver>
<ui:timeout>60</ui:timeout>
</ui:createDriver>
<ui:javaScriptExecutor />
<addReporter type="xml" name="Create Company Master" description="Testing Company Master application functionality" class="rs.cdl.maxtaf.test.CompanyMasterTestUI" author="Pera" />
</beforeTestCase>
<beforeTest>
Executes the content of this element before each test. This element can be used to prepare the environment for the execution of the test. Note: the processing will be repeated before every test in the test case.
Example (synthesised):
<beforeTest />
<getTestParam>
Gets a specific run parameter value of the Test and places it into the specified variable. Parameters are defined in the Maximo front-end Test application.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of test parameter which value we want to get. |
variable |
yes | Variable into which parameter value will be stored. |
Example:
Parameters defined in the Test application:
woNum='1000'
siteId = 'BEDFORD'
Code:
<var name="wonum" type="String">""</var>
<var name="siteid" type="String">""</var>
<getTestParam name="woNum" variable="wonum" />
<getTestParam name="siteId" variable="siteid" />
<addReportLine action="wonum: $wonum" expected="" actual="" status="PASSED" />
<addReportLine action="siteid: $siteid" expected="" actual="" status="PASSED" />
<setTestParam>
Sets a specific run parameter value of the Test. Parameters are defined in the Maximo front-end Test application.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of test parameter which value we want to set. |
value |
yes | Value that we want to set. |
Example:
Parameters defined in the Test application:
woNum='1000'
siteId = 'BEDFORD'
Code:
<setTestProperty name="woNum" value="1000" />
<setTestProperty name="siteId" value="EAGLENA" />
<addReportLine action="wonum: $wonum" expected="" actual="" status="PASSED" />
<addReportLine action="siteid: $siteid" expected="" actual="" status="PASSED" />
<test>
Contains the actual test processing. This is the main test element in which you perform all of the test processing.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the test. |
id |
no | ID of the test. |
annotation |
no | Java method annotation. To have more than one annotation, separate them by \n e.g. "@Ignore\n@Override" |
Example:
<test name="ifTest">
</test>
<method>
Method element.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the test. |
id |
no | ID of the test. |
annotation |
no | Java method annotation. To have more than one annotation, separate them by \n e.g. "@Ignore\n@Override" |
type |
no | Java method return type. |
accessLevel |
no | Java method access level. |
static |
no | Java method access level. |
parameters |
no | Method parameters in standard Java format. Example: <method name='addTwoNumbers' parameters='Integer a, Float b' |
Child elements: <var>, <set>, <include>, <return>
Example (synthesised):
<method name="..." id="..." annotation="...">
<var>...</var>
<set>...</set>
</method>
<testReportStatus>
Sets report status. Report status will be set to the element value.
Text content: xsd:string
Example:
<testReportStatus>PASSED</testReportStatus>
<if>
Executes content if the condition is true.
| Attribute | Required | Description |
|---|---|---|
condition |
yes | This is a logical expression that is evaluated. It must follow Java format for boolean expressions. |
Example:
<var name="myInt" type="int">1</var>
<if condition="myInt==1">
<addReportLine action="ifTest" expected="if Triggered" actual="if Triggered" status="PASSED" />
</if>
<else>
Used only with existing <if> tag. Executes code in case the <if> tag condition is not met. Note: This element must be positioned immediately after the </if> tag.
Example:
<var name="b" type="int">2</var>
<if condition="b==1">
<addReportLine action="ifTest" expected="if Triggered" actual="if Triggered" status="PASSED" />
</if>
<else>
<addReportLine action="elseTest" expected="else Triggered" actual="else Triggered" status="PASSED" />
</else>
<for>
Repeats the processing of its content until the condition is false. This loop element is based on Java "for" loop and must have the iterator, condition and iteration attributes defined.
| Attribute | Required | Description |
|---|---|---|
iterator |
yes | Iterator value. Example: "int i = 0" |
condition |
yes | Condition for the loop. Example: "i < 10" "i <= 10" |
iteration |
yes | Iteration expression. Example: "i++" "i--" |
Example:
<for iterator="int i=0" condition="i<10" iteration="i++">
<printOut>i</printOut>
<addReportLine action="Increasing iterator value, value is $String.valueOf(i)" expected="iterator value:" actual="value is $String.valueOf(i) " status="PASSED" />
</for>
<forEach>
Loops through elements of the given array or collection.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable that receives the array element of the current iteration. You MUST specify the type of the variable together with its name e.g. "String car". You cannot reuse already declared variable. |
array |
yes | Array to be looped through. |
Example:
<var name="cars" type="String[]">{"Volvo", "BMW", "Ford", "Mazda"}</var>
<forEach var="String car" array="cars">
<sys:addLogLine text="Car brand: $car"/>
</forEach>
<while>
Repeats the processing of its content until the condition becomes false.
| Attribute | Required | Description |
|---|---|---|
condition |
yes | This is a logical expression that is evaluated. It must follow Java format for boolean expressions. |
Example:
<while condition="counter<5">
<printOut>counter</printOut>
<addReportLine action="Increasing counter value" expected="counter value:" actual="$String.valueOf(counter) " status="PASSED" />
<set variable="counter">counter+1</set>
</while>
<reportGroup>
Overrides MaxTAF generated test reports with custom action, expected, actual and status messages. Actual message will be overridden by passActual attribute in case the test passes, or will be set by the failActual attribute in case the test fails. Status message will be overridden by passStatus attribute in case the test passes, otherwise will be set by the failStatus attribute in case the test fails.
| Attribute | Required | Description |
|---|---|---|
action |
yes | Describes the test action, e.g. "Approve Work Order". |
expected |
yes | Describes the expected outcome of the action. E.g. "Work Order Approved". |
failActual |
yes | Describes the failed outcome of the action. E.g. "Work Order Not Approved". |
passActual |
yes | Describes the successful outcome of the action. E.g. "Work Order Approved Successfully". |
failStatus |
yes | Status to set for the failed outcome. |
passStatus |
yes | Status to set for the successful outcome. |
Example:
<reportGroup action="Check publish channel" expected="disabled" passActual="disabled. " failActual="enabled" passStatus="GOOD" failStatus="BAD">
<mif:publishChannelExistOnExternalSystem name="MXWOInterface" externalSystemName="EXTSYS1"/>
<mif:publishChannelEnabled name="MXWOInterface" externalSystemName="EXTSYS1"/>
<mif:publishChannelEventListenerEnabled name="MXWOInterface"/>
</reportGroup>
<dowhile>
Executes code conditionally until the condition is no longer met.
| Attribute | Required | Description |
|---|---|---|
condition |
yes | This is a logical expression that is evaluated for every iteration of the loop. It must follow Java format for boolean expressions. |
Example:
<var name="a" type="int">1</var>
<dowhile condition="a < 10">
<set variable="a">a+1</set>
</dowhile>
<getMaxtafProperty>
Gets the value of MaxTAF property and puts it in variable.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of MaxTAF property which value we want to get. |
var |
yes | Variable into which property value will be stored. |
Example:
<var type="String" name="prop">""</var>
<getMaxtafProperty name="propName" var="prop" />
<incrementProperty>
Increments the value of MaxTAF property in thread-safe manner.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of MaxTAF property which will be incremented. Must be a long value |
var |
yes | Variable into which incremented value will be stored. |
Example (synthesised):
<incrementProperty name="..." var="..." />
<inverse>
Inverses the outcome of the contained element. Used to inverse the logic of a specified element. I.e. where the specified element fails, the inverse passes; where the specified element passes the inverse fails.
Example:
<!-- pass if www.maxtaf.com is unreachable (testing the firewall) -->
<inverse>
<net:ping host="http://www.maxtaf.com"/>
</inverse>
<block>
Localizes variables defined within this element. The variables defined within this element will be visible to other elements in the block, but will not be visible to the rest of the test elements.
Example:
<block>
<var name="a" type="int">0</var>
<addReportLine action="value of a is $a" expected="" actual="" status="PASSED" />
</block>
<block>
<var name="a" type="int">1</var>
<addReportLine action="value of a is $a" expected="" actual="" status="PASSED" />
</block>
<native>
Inserts Java code contained in the content of the element into the processing logic.
Text content: xsd:string
Example (synthesised):
<native>System.out.println("Hello from Java");</native>
<execute>
Executes specified object's method using the given parameters. The executed method must not return a value. As all MXML objects are Java objects, this element can invoke any of the Java methods available for the object's class. To understand object's methods, consult the Java documentation for the object's class. Note: For methods that return a value, use "executeWithReturn" element.
Child element(s): <params> - this is an optional element which is used when we want to execute a method that contains parameters. Method parameters should be written in element content, separated by commas in the same way as they would be written in Java, as in the example below:
| Attribute | Required | Description |
|---|---|---|
object |
yes | Object reference |
method |
yes | Method name |
Child elements: <params>
Example:
<!-- equivalent to Java "String myString = "Test String"; myString.indexOf("ring", 1);
<var name="myString" type="String">"Test String"</var>
<execute object="myString" method="indexOf">
<params>"ring", 1</params>
</execute>
<call>
Executes class method using the given parameters. The executed method must not return a value. As all MXML objects are Java objects, this element can invoke any of the Java methods available for the object's class. To understand object's methods, consult the Java documentation for the object's class. Note: For methods that return a value, use "callWithReturn" element.
Child element(s): <params> - this is an optional element which is used when we want to execute a method that contains parameters. Method parameters should be written in element content, separated by commas in the same way as they would be written in Java, as in the example below:
| Attribute | Required | Description |
|---|---|---|
method |
yes | Method name |
Child elements: <params>
Example:
<!-- equivalent to Java "printHelloWorldFrom("Peter");
<call method="printHelloWorldFrom">
<params>"Peter"</params>
</call>
<fileToString>
Reads file content and stores it into the String variable.
| Attribute | Required | Description |
|---|---|---|
filePath |
yes | Absolute file path. |
var |
yes | Variable that will hold the content of the file as String. |
Example:
<fileToString filePath="C:/temp/tmp.csv" var="myVar" />
<stringToFile>
Writes into file the content of the String variable.
| Attribute | Required | Description |
|---|---|---|
filePath |
yes | Absolute file path. |
fileContent |
yes | Content that will be saved into the file. |
Example:
<stringToFile content="$myText" filePath="C:/temp/tmp.csv" />
<stringReplace>
Replaces substring in the String variable with another substring.
| Attribute | Required | Description |
|---|---|---|
replace |
yes | Value to be replaced. |
with |
yes | New value to be set. |
var |
yes | Variable holding the value that will be modified. |
Example:
<stringReplace var="myString" replace="tbl" with="table" />
<executeWithReturn>
Executes specified object's method using the given parameters and stores the return value in the specified variable. The executed method must return a value. As all MXML objects are Java objects, this element can invoke any of the Java methods available for the object's class. To understand object's methods, consult the Java documentation for the object's class. Note: For methods which do not return a value, use "execute" element.
Child elements: <params> - this is optional element which is used if we want to execute method that contains parameters. Method parameters should be written in element's content like in the example below:
| Attribute | Required | Description |
|---|---|---|
object |
yes | Object reference |
method |
yes | Method name |
var |
yes | Variable that will hold the returned value of the method. |
Child elements: <params>
Example:
<var name="myString" type="String">"Test String"</var>
<var name="ringPos" type="int">0</var>
<executeWithReturn object="myString" method="indexOf" var="ringPos">
<params>"ring", 1</params>
</executeWithReturn>
<addReportLine action="Result: $ringPos" expected="" actual="" status="PASSED" />
<callWithReturn>
Executes specified class method using the given parameters and stores the return value in the specified variable. The executed method must return a value. Note: For methods which do not return a value, use "call" element.
Child elements: <params> - this is optional element which is used if we want to execute method that contains parameters. Method parameters should be written in element's content like in the example below:
| Attribute | Required | Description |
|---|---|---|
method |
yes | Method name |
var |
yes | Variable that will hold the returned value of the method. |
Child elements: <params>
Example:
<var name="result" type="int">0</var>
<callWithReturn method="multiplyTwoIntegers" var="result">
<params>5,6</params>
</callWithReturn>
<addReportLine action="Result: $result" expected="" actual="" status="PASSED" />
<assertFail>
Unconditionally fails the test. If the optional subelement "assertMessage" is present, the value of this element will be displayed as the failure explanation.
Child elements: <assertMessage>
Example:
...
<if condition="mboRemoteWO=null">
<assertFail>
<assertMessage> Work Order not found</assertMessage>
</assertFail>
</if>
<assertTrue>
Asserts whether the condition is true. Displays assertMessage on failure.
| Attribute | Required | Description |
|---|---|---|
condition |
yes | This is a logical expression. It must follow Java format for boolean expressions. Example: 1) String compare <assertFalse condition='myString.equals("ABC")'/> 2) Number compare <assertTrue condition='myInt == 15'/> |
Child elements: <assertMessage>
Example:
<var name="a" type="String">"Test String 1"</var>
<var name="b" type="String">"Test String 1"</var>
<assertTrue condition="a.equals(b)">
<assertMessage>Condition is not true. Test failed.</assertMessage>
</assertTrue>
<assertNull>
Checks that the object is null. Object can be of any Java type.
| Attribute | Required | Description |
|---|---|---|
object |
yes | Object to be checked for null. Can be any Java object type, e.g. String, int etc. |
Child elements: <assertMessage>
Example:
<var name="myString" type="String">"Test"</var>
<assertNull object="myString">
<assertMessage>Object is not null. Test failed.</assertMessage>
</assertNull>
<imports>
Imports additional Java classes and packages. The Java classes and packages are specified in children <import> elements.
Child elements: <import>
Example:
<imports>
<import>
java.lang.Exception
</import>
<import>
com.codedevelopment.maxtaf.util.*
</import>
</imports>
<globals>
Used do define global variables. Global variables are visible in all tests in test case.
Child elements: <var>
Example:
<testCase>
<globals>
<var type="String" name="var1">"Variable 1"</var>
<var type="int" name="var2">1001</var>
</globals>
...
<assertSame>
Checks that both variables refer to the same object. Variables can be of any Java type.
| Attribute | Required | Description |
|---|---|---|
expected |
yes | Object which is expected to be the same as the actual object. Can be of any Java type. |
actual |
yes | Object to check against. Can be of any Java type. |
Child elements: <assertMessage>
Example:
<var name="myInt1" type="Integer">new Integer(1)</var>
<var name="myInt2" type="Integer">myInt1</var>
<var name="myInt3" type="Integer">myInt1</var>
<assertSame expected="myInt2" actual="myInt3">
<assertMessage>Expected object is not the same as actual object. Test failed.</assertMessage>
</assertSame>
<assertNotSame>
Checks that both variables refer to different objects. Must contain both unexpected and actual attributes, then compares the two. If they are referencing different objects, returns true else returns false.
| Attribute | Required | Description |
|---|---|---|
unexpected |
yes | Object which is not expected to be the same as the actual object. |
actual |
yes | Object to check against. |
Child elements: <assertMessage>
Example:
<var name="myString1" type="String">new String("abc")</var>
<var name="myString2" type="String">new String("abc")</var>
<assertNotSame unexpected="myString1" actual="myString2">
<assertMessage>Unexpected is same as actual. Test failed.</assertMessage>
</assertNotSame>
<assertNotNull>
Checks that the object is not null. Object can be of any Java type.
| Attribute | Required | Description |
|---|---|---|
object |
yes | Object for which the null state is asserted. Can be any Java type object. |
Child elements: <assertMessage>
Example:
<var name="myString" type="String">"Test"</var>
<assertNotNull object="myString">
<assertMessage>Object is null. Test failed.</assertMessage>
</assertNotNull>
<assertFalse>
Asserts whether the condition is false. If the condition is true, the test fails.
| Attribute | Required | Description |
|---|---|---|
condition |
yes | This is a logical expression. It must follow the Java format for boolean expressions. Example: 1) String compare <assertFalse condition='myString.equals("ABC")'/> 2) Number compare <assertTrue condition='myInt == 15'/> |
Child elements: <assertMessage>
Example:
<assertFalse condition="1==2"/>
<assertEquals>
Checks that both variables refer to same objects.
| Attribute | Required | Description |
|---|---|---|
expected |
yes | Expected value. |
actual |
yes | Actual value. |
Child elements: <assertMessage>, <delta>
Example:
<assertEquals expected="VALID" actual="myVar">
<assertMessage></assertMessage>
</assertEquals>
UI / Selenium Tags (ui:)
Browser and web-UI automation: driver lifecycle, clicks, input, waits, asserts, frames/windows.
UI Selectors (child elements)
Most ui: action tags take exactly one selector child element that identifies the target web element. Each maps to a Selenium By locator. The same six selectors are valid inside ui:click, ui:sendKeys, ui:assertValue, ui:getText, and the other element-targeting tags.
| Selector | Finds element by | Maps to | Example |
|---|---|---|---|
<ui:id> |
element id attribute |
By.id |
<ui:id>saveButton</ui:id> |
<ui:xpath> |
XPath expression | By.xpath |
<ui:xpath>//*[@staticId='save']</ui:xpath> |
<ui:cssSelector> |
CSS selector | By.cssSelector |
<ui:cssSelector>.btn-primary</ui:cssSelector> |
<ui:linkText> |
exact link text | By.linkText |
<ui:linkText>Sign out</ui:linkText> |
<ui:name> |
element name attribute |
By.name |
<ui:name>username</ui:name> |
<ui:tagName> |
HTML tag name | By.tagName |
<ui:tagName>button</ui:tagName> |
<ui:createDriver>
Creates a connection to the web driver. When a UI test is created this is automatically inserted into the <beforeTestCase> tag.
Child elements: <ui:timeout>, <ui:extraCap>
Example (synthesised):
<ui:createDriver>
<ui:timeout>...</ui:timeout>
<ui:extraCap>...</ui:extraCap>
</ui:createDriver>
<ui:timeout>
Sets timeout for UI actions.
Example (synthesised):
<ui:timeout />
<ui:extraCap>
Sets extra capability for the driver. If you are entering a string as the value for the capability, you need to surround it with double quotes and single quotes. E.g. <ui:extraCap name="exampleCap" value='"exampleValue"'/>
Text content: xs:string
| Attribute | Required | Description |
|---|---|---|
name |
no | — |
value |
no | — |
Example (synthesised):
<ui:extraCap name="..." value="...">value</ui:extraCap>
<ui:javaScriptExecutor>
Provides access to the mechanism for executing JavaScript. Created automatically by the UI test within the beforeTestCase tag.
Example:
<beforeTestCase>
<ui:createDriver>
<ui:timeout>120</ui:timeout>
</ui:createDriver>
<ui:javaScriptExecutor/>
<addReporter type="xml"
name="Test Title"
description="Test Description"
class="Test Class"
author="Autor"
></addReporter>
</beforeTestCase>
<ui:getVerificationErrors>
Returns verification errors and prints report lines for them. Works with verify tags (for example: ui:verifyText). If a verify tag returns one or more errors, this element will list them all.
Example (synthesised):
<ui:getVerificationErrors />
<ui:openApp>
Opens the specified application. Name must be a valid Maximo application name.
| Attribute | Required | Description |
|---|---|---|
name |
yes | String which holds the application name. |
Child elements: <ui:userName>, <ui:password>
Example:
<ui:openApp name="startcntr"/>
<ui:changeApp>
Opens the specified application. Name must be a valid Maximo application name.
| Attribute | Required | Description |
|---|---|---|
name |
yes | String which holds the application name. |
Example:
<ui:changeApp name="startcntr"/>
<ui:executeScript>
Executes JavaScript on the test page. Can interact with existing JavaScript created by the test logic.
| Attribute | Required | Description |
|---|---|---|
jsCode |
yes | This is a JavaScript code expression. Must follow standard JavaScript coding format. |
Example:
<ui:executeScript jsCode="warnExit=false" />
<ui:executeScriptOnTarget>
Executes JavaScript on a given target element. Can interact with existing JavaScript created by the test logic.
| Attribute | Required | Description |
|---|---|---|
jsCode |
yes | This is a JavaScript code expression. Must follow standard JavaScript coding format. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:executeScriptOnTarget jsCode="if(arguments[0].contentEditable === 'true')
{arguments[0].innerText = 'sample text'}">
<ui:id>dijitEditorBody</ui:id>
</ui:executeScriptOnTarget>
<ui:click>
Performs a click on an element. Used mostly to click link elements on the page.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<addReportLine
action="Click Change Status button"
expected="Change Status dialogue is displayed"
actual="Change Status dialogue is displayed"
status="PASSED" />
<ui:click>
<ui:xpath>//*[@staticId='toolactions_button_14-toolbarbutton_image_image']</ui:xpath>
</ui:click>
<ui:mouseOver>
Simulates hover over an element.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<addReportLine action="Click Change Status button" expected="Change Status dialogue is displayed"
actual="Change Status dialogue is displayed" status="PASSED" />
<ui:mouseOver>
<ui:id>some_id</ui:id>
</ui:mouseOver>
<ui:getElementPresent>
Element that checks if specified element is somewhere on the page and stores the result in variable. Must match only one child element that is returned by the selector.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Boolean variable to store results. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<var name="isElemPresent" type="Boolean">null</var>
<ui:getElementPresent var="isElemPresent">
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:getElementPresent>
<ui:assertElementPresent>
Element that checks if specified element is somewhere on the page. Must match only one child element that is returned by the selector.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:assertElementPresent>
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertElementPresent>
<ui:assertElementError>
Element that checks if specified element has an error icon on the page. Must match only one child element that is returned by the selector.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:assertElementError>
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertElementError>
<ui:assertElementRequired>
Element that checks if specified element is marked as required on the page. Must match only one child element that is returned by the selector.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:assertElementRequired>
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertElementRequired>
<ui:assertElementReadonly>
Element that checks if specified element is marked as read only on the page. Must match only one child element that is returned by the selector.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:assertElementReadonly>
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertElementReadonly>
<ui:waitForElementPresent>
Verifies a matched element will show up on the page in the specified number of seconds. Must match only one element returned by the selector.
| Attribute | Required | Description |
|---|---|---|
time |
no | Time interval in seconds. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:waitForElementPresent time="30">
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_label']</ui:xpath>
</ui:waitForElementPresent>
<ui:verifyElementPresent>
Verifies if specified element is somewhere on the page. Must match only one element returned by the selector.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:verifyElementPresent>
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:verifyElementPresent>
<ui:getTextPresent>
Checks if certain text appears somewhere on the rendered page. Returned value is stored into the referenced variable.
| Attribute | Required | Description |
|---|---|---|
text |
yes | Text value which is to be searched for. |
var |
yes | String which will store the returned value. |
Example:
<var type="String" name="elemTextPresent">""</var>
<ui:getTextPresent text="o To" var="elemTextPresent" />
<addReportLine action="Checking if text is present on the page" expected="Element text is present
on the page" actual="Element text is present: $elemTextPresent" status="PASSED" />
<ui:assertTextPresent>
Checks if certain text appears somewhere on the rendered page.
| Attribute | Required | Description |
|---|---|---|
text |
yes | String to be matched with the text on the rendered page. |
Example:
<ui:assertTextPresent text="Work Order Tracking"/>
<ui:waitForTextPresent>
Verifies if certain text appears somewhere on the rendered page in the specified number of seconds.
| Attribute | Required | Description |
|---|---|---|
text |
yes | String to be matched with the text on the rendered page. |
time |
no | Time interval in seconds. |
Example:
<ui:waitForTextPresent text="Originating Record:" time="30" />
<ui:verifyTextPresent>
Verifies if certain text appears somewhere on the rendered page.
| Attribute | Required | Description |
|---|---|---|
text |
yes | String which holds the text to be searched for on the rendered page. |
Example:
<ui:verifyTextPresent text="o To" />
<ui:getTitle>
Stores the title of the current page into the specified variable.
| Attribute | Required | Description |
|---|---|---|
var |
yes | String which holds the returned value. |
Example:
<var type="String" name="pageTitle">""</var>
<ui:getTitle var="pageTitle" />
<ui:assertTitle>
Element that checks if certain text is equal to title of the current page.
| Attribute | Required | Description |
|---|---|---|
title |
yes | String which is expected to be the same as the title of the page. |
Example:
<ui:assertTitle title="Work Order Tracking" />
<ui:waitForTitle>
Verifies if specified text will be equal to the rendered page title in the specified number of seconds.
| Attribute | Required | Description |
|---|---|---|
title |
yes | String which is to be matched to the page title. |
time |
no | Time interval in seconds. |
Example:
<ui:waitForTitle title="Work Order" time="30" />
<ui:verifyTitle>
Verifies that the title of the page matches the specified title text.
| Attribute | Required | Description |
|---|---|---|
title |
yes | Title value that will be checked. |
Example:
<ui:verifyTitle title="Work Order" />
<ui:assertValue>
Element that checks if certain text is equal to a value of an input web element. Must have one and only one child element that is returned by the selector.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
| Attribute | Required | Description |
|---|---|---|
value |
yes | Value string which is expected to be the same as the value of the input element returned by the selector. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- when a work order is created, Maximo should auto-populate the Class field with value
"WORKORDER" -->
<ui:assertValue value="WORKORDER">
<ui:xpath>//*[@staticId='main_grid3_2-textbox_textbox']</ui:xpath>
</ui:assertValue>
<ui:waitForValue>
Verifies if the specified text will be equal to the value of an input element in the specified number of seconds.
| Attribute | Required | Description |
|---|---|---|
value |
yes | Value to be waited for. |
time |
no | Time interval in seconds. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:waitForValue value="WORKORDER" time="10">
<ui:xpath>//*[@staticId='main_grid3_2-textbox_textbox']</ui:xpath>
</ui:waitForValue>
<ui:verifyValue>
Verifies if specified text is equal to value of input web element. Must match only one element returned by the selector.
| Attribute | Required | Description |
|---|---|---|
value |
yes | Value that will be checked. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:verifyValue value="1001">
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:verifyValue>
<ui:assertText>
Element that checks if certain text is equal to text content of web element. Must have one and only one child element that represent selector by which element will be found.
Selectors:
ui:xpath - finds web element by its xpath ui:id - finds web element by its id ui:cssSelector - finds web element by its CSS class ui:linkText - finds web element by its link text ui:name - finds web element by its name ui:tagName - finds web element by its tag name
| Attribute | Required | Description |
|---|---|---|
text |
yes | Text that will be checked. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:assertText text="Go To">
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertText>
<ui:waitForText>
Verifies if specified text will be equal to text content of web element in specified number of seconds. Must match only one element returned by the selector.
| Attribute | Required | Description |
|---|---|---|
text |
yes | Text to be waited for |
time |
no | Time interval in seconds. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:waitForText text="Originating Record:" time="30">
<ui:xpath>//*[@staticId='main_grid9_1-textbox_label']</ui:xpath>
</ui:waitForText>
<ui:verifyText>
Verifies if certain text is equal to text content of web element. Must match only one child element that is returned by the selector.
| Attribute | Required | Description |
|---|---|---|
text |
yes | String which is the value that is being verified. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:verifyText text="o To">
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:verifyText>
<ui:getValue>
Gets value of text input element. Must match only one element returned by the selector.
| Attribute | Required | Description |
|---|---|---|
var |
yes | String which will store the returned value. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<var type="String" name="woNum">""</var>
<ui:getValue var="woNum">
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_1']</ui:xpath>
</ui:getValue>
<addReportLine action="Getting work order number" expected="Work Order number can be fetched"
actual="WONUM is $woNum" status="PASSED" />
<ui:getText>
Gets text content of web element (for example a label text) and stores it into a variable. Must match only one child element returned by the selector.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which holds the returned value. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<var type="String" name="elemText">""</var>
<ui:getText var="elemText">
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:getText>
<addReportLine action="Get element text" expected="Element text can be fetched" actual="Element
text is $elemText" status="PASSED" />
<ui:getAttribute>
Gets attribute value of web element. Must match only one child element represented by the selector.
| Attribute | Required | Description |
|---|---|---|
var |
yes | String which will store the returned value. |
name |
yes | Name of the attribute. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<var type="String" name="descAttribute">""</var>
<ui:getAttribute var="descAttribute" name="id">
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:getAttribute>
<addReportLine action="Get Description field ID" expected="ID is retrieved" actual="id:
$descAttribute" status="PASSED" />
<ui:screenshot>
Captures a screenshot of the page and stores it into the specified file.
Example (synthesised):
<ui:screenshot />
<ui:pause>
Pauses case execution and waits for "Continue to be pressed"
Example (synthesised):
<ui:pause />
<ui:wait>
Sets a time out period in the execution of the test. Will pause execution of the subsequent tag for the given period of time (expressed in seconds in the "time" attribute).
| Attribute | Required | Description |
|---|---|---|
time |
yes | Time interval in seconds. |
Example:
<ui:click>
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:click>
<ui:wait time="30" />
<ui:clear>
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:clear>
<ui:sendKeys>
Simulates typing into a text input web element. Must match only one child element that is returned by the selector.
| Attribute | Required | Description |
|---|---|---|
text |
yes | String which will be sent to the textbox element. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:sendKeys text="test">
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:sendKeys>
<addReportLine action="Enter 'test' as description" expected="Description is populated"
actual="Description is populated" status="PASSED" />
<ui:setInnerHTML>
Sets the element's inner html. Replaces any html found in the element located.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>, <ui:content>
Example:
<ui:setInnerHTML>
<ui:id>dijitEditorBody</ui:id>
<ui:content>
<![CDATA[testing <span style="font-weight: bold;">setInnerHTML</span><br>using
different <span style="font-family: monospace;">font </span><br>and <span
style="text-decoration: underline;"><span style="font-weight: bold;">style </span></span><br><div></div>
]]>
</ui:content>
</ui:setInnerHTML>
<ui:clear>
Clears a text field.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<ui:clear>
<ui:xpath>//*[@staticId='changestatus_grid1_1_1_grid4_3a-textbox_textbox']</ui:xpath>
</ui:clear>
<ui:close>
Closes the connection to the web driver. Automatically added to a UI test within the <afterTestCase> tag.
Example:
<ui:close/>
<ui:login>
Log in user with specified username and password.
Child elements: <ui:userName>, <ui:password>
Example (synthesised):
<ui:login>
<ui:userName>...</ui:userName>
<ui:password>...</ui:password>
</ui:login>
<ui:logout>
Log out the current user.
Example:
<ui:logout />
<ui:maximizeWindow>
Maximizes the browser window.
Example:
<ui:maximizeWindow />
<ui:switchToWindow>
Switches control to different window with specified title. If closeCurrent attribute is true, current window will be closed before switching.
| Attribute | Required | Description |
|---|---|---|
title |
yes | Title of the window. Must be same title as the head tag title of the page. |
closeCurrent |
yes | Value that determines if the current window is closed before switching. |
Example:
<ui:switchToWindow title="BIRT Report Viewer" closeCurrent="false" />
<ui:switchToMainWindow>
Switches control to the main window. Main window is the window in which the test started running.
| Attribute | Required | Description |
|---|---|---|
closeCurrent |
yes | Value that determines if the current window is closed before switching to main window. |
Example:
<ui:switchToMainWindow closeCurrent="true" />
<ui:switchToFrame>
Switches focus to the specified frame. Mostly used for interaction with elements in iFrames.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- clicking on element inside iFrame with xpath "//*[@id='uploadIFrame']/span[2]/span" and
returning to default frame -->
<ui:switchToFrame>
<ui:xpath>//*[@id='uploadIFrame']</ui:xpath>
</ui:switchToFrame>
<ui:click>
<ui:xpath>//*[@id='uploadIFrame']/span[2]/span</ui:xpath>
</ui:click>
</ui:switchToDefaultFrame/>
<ui:switchToDefaultFrame>
Switches focus to the main frame of the page. Mostly used to return from iFrame previously focused on.
Example:
<!-- clicking on element inside iFrame with xpath "//*[@id='uploadIFrame']/span[2]/span" and
returning to default frame -->
<ui:switchToFrame>
<ui:xpath>//*[@id='uploadIFrame']</ui:xpath>
</ui:switchToFrame>
<ui:click>
<ui:xpath>//*[@id='uploadIFrame']/span[2]/span</ui:xpath>
</ui:click>
</ui:switchToDefaultFrame/>
<ui:clickSimple>
Clicks on element by performing native click event. Use this as an alternative to ui:click when ui:click doesn't work.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- simple click -->
<ui:clickSimple>
<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
</ui:clickSimple>
<ui:doubleClick>
Double clicks on the element.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- double click -->
<ui:doubleClick>
<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
</ui:doubleClick>
<ui:clickError>
Clicks on the error field inside an element.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- error click -->
<ui:clickError>
<ui:id>mad3161b5-tb</ui:id>
</ui:clickError>
<ui:clickEvent>
Directly executes Maximo java script function sendEvent. Use this as an alternative to ui:click when ui:click doesn't work.
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- sendEvent click -->
<ui:clickEvent>
<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
</ui:clickEvent>
<ui:sendParam>
Sends the test parameter value to specified field.
| Attribute | Required | Description |
|---|---|---|
name |
yes | String which holds the test parameter name. |
Child elements: <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>
Example:
<!-- sendParam -->
<ui:sendParam name="paramName">
<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
</ui:sendParam>
<ui:waitForUserAction>
Pauses the test execution and wait for the user action defined in the "action" sub-command. For action clickElement: user should click on the highlighted element. For action clickContinue: user should click on the continue button. This action can contain sub-command that will highlight passed element.
Child elements: <ui:shiftElementPosition>, <ui:hint>, <ui:message>, <ui:action>, <ui:clickContinue>, <ui:highlight>, <ui:xpath>, <ui:id>, <ui:cssSelector>, <ui:linkText>, <ui:name>, <ui:tagName>, <ui:clickElement>, <ui:waitForTextInput>
Example:
<ui:waitForUserAction>
<ui:message>message to show</ui:message>
<ui:action>
<!-- action to execute, for test to continue -->
<!-- use ONLY ONE of the following -->
<ui:clickContinue>
<!-- optional tag to highlight passed element -->
<ui:highlight>
<ui:id>element_to_be_highlighted_id</ui:id>
</ui:highlight>
</ui:clickContinue>
<ui:clickElement>
<ui:id>element_to_be_clicked_id</ui:id>
</ui:clickElement>
</ui:action>
</ui:waitForUserAction>
Database Tags (db:)
JDBC database access: connections, SQL execution, and typed reads from result sets.
<db:connection>
Creates a connection to database.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold the connection. |
Child elements: <db:url>, <db:password>, <db:userName>
Example:
<var type="Connection" name="myConnection">
<db:connection var="myConnection">
<db:url>jdbc:oracle:thin:@//localhost:1521/max1</db:url>
<db:password>maximo</db:password>
<db:userName>maximo</db:userName>
</db:connection>
<db:sql>
SQL to execute on specified DB connection. Returned result set is stored into variable.
Text content: string
| Attribute | Required | Description |
|---|---|---|
var |
no | Variable of type ResultSet which will hold query results. |
connection |
yes | Instance of Connection that is still open (See "db:connection" command). |
Example:
<var type="ResultSet" name="rs">null</var>
<db:sql connection="dataLoaderConn" var="rs">
select * from staging_asset
</db:sql>
<db:forEachResult>
Loops through given result set and fetches records. For each fetched record the nested child elements will be processed.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
Child elements: <db:getStringFromResult>, <db:getIntFromResult>, <db:getDateFromResult>, <db:getTimestampFromResult>, <db:getLongFromResult>, <db:getFloatFromResult>, <db:getBooleanFromResult>, <db:getClobFromResult>, <db:getBlobFromResult>, <db:getBytesFromResult>, <db:getByteFromResult>
Example:
<db:forEachResult resultSet="rs">
<var name="result1" type="String">
null
</var>
<db:getStringFromResult fieldName="WONUM" var="result1"/>
<printOut>
result1
</printOut>
</db:forEachResult>
Within this element you can use elements which get values from the current record. Those elements are:
<getStringFromResult> - Gets string value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched String value.
Example:
<var name="result1" type="String">
null
</var>
<db:getStringFromResult fieldName="WONUM" var="result1"/>
<getIntFromResult> - Gets integer value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched integer value.
Example:
<var name="resultInt" type="int">
0
</var>
<db:getIntFromResult fieldName="ESTMATCOST" var="resultInt"/>
<getDateFromResult> - Gets date value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched date value.
Example:
<var name="resultDate" type="int">
0
</var>
<db:getIntFromResult fieldName="PMDUEDATE" var="resultDate"/>
<getTimestampFromResult> - Gets timestamp value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched timestamp value.
Example:
<var name="resultTimestamp" type="Timestamp">
null
</var>
<db:getTimestampFromResult fieldName="STATUSDATE" var="resultTimestamp"/>
<getLongFromResult> - Gets long value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched long value.
Example:
<var name="resultLong" type="long">
0
</var>
<db:getLongFromResult fieldName="WORKORDERID" var="resultLong"/>
<getFloatFromResult> - Gets float value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched float value.
Example:
<var name="resultFloat" type="float">
0
</var>
<db:getFloatFromResult fieldName="WOPRIORITY" var="resultFloat"/>
<getBooleanFromResult> - Gets boolean value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched boolean value.
Example:
<var name="resultBoolean" type="boolean">
false
</var>
<db:getBooleanFromResult fieldName="WOACCEPTSCHARGES" var="resultBoolean"/>
<getClobFromResult> - Gets clob value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched clob value.
Example:
<var name="resultClob" type="Clob">
null
</var>
<db:getClobFromResult fieldName="LDTEXT" var="resultClob"/>
<getBlobFromResult> - Gets blob value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched blob value.
Example:
<var name="resultBlob" type="Blob">
null
</var>
<db:getBlobFromResult fieldName="RESOURCES" var="resultBlob"/>
<getBytesFromResult> - Gets bytes value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched bytes value.
Example:
<var name="resultBytes" type="byte[]">
null
</var>
<db:getBytesFromResult fieldName="RESOURCES" var="resultBytes"/>
<getByteFromResult> - Gets byte value from the record fetched by db:forEachResult.
Attributes: fieldName - Name of the field from which value will be fetched.
var - Variable which will hold fetched byte value.
Example:
<var name="resultByte" type="byte">
0
</var>
<db:getByteFromResult fieldName="ASSETLOCPRIORITY" var="resultByte"/>
<db:getStringFromResultSet>
Gets string value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched String value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultString" type="String">
null
</var>
<db:getStringFromResultSet resultSet="rs" field="WONUM" row="1" var="resultString"/>
<db:closeConnection>
Closes opened database connection defined by db:connection.
| Attribute | Required | Description |
|---|---|---|
connection |
yes | Variable which holds the connection. |
Example:
<db:closeConnection connection = "myConnection"/>
<db:getDateFromResultSet>
Gets Date value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched Date value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultDate" type="Date">
null
</var>
<db:getDateFromResultSet resultSet="rs" field="PMDUEDATE" row="1" var="resultDate"/>
<db:getTimestampFromResultSet>
Gets Timestamp value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched Timestamp value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultTimestamp" type="Timestamp">
null
</var>
<db:getTimestampFromResultSet resultSet="rs" field="STATUSDATE" row="1" var="resultTimestamp"/>
<db:getLongFromResultSet>
Gets long value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched long value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultLong" type="long">
0
</var>
<db:getLongFromResultSet resultSet="rs" field="WORKORDERID" row="1" var="resultLong"/>
<db:getFloatFromResultSet>
Gets float value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched float value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultFloat" type="float">
0
</var>
<db:getFloatFromResultSet resultSet="rs" field="WOPRIORITY" row="3" var="resultFloat"/>
<db:getBooleanFromResultSet>
Gets boolean value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched boolean value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultBoolean" type="boolean">
false
</var>
<db:getBooleanFromResultSet resultSet="rs" field="WOACCEPTSCHARGES" row="1" var="resultBoolean"/>
<db:getClobFromResultSet>
Gets CLOB value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched Clob value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultClob" type="Clob">
null
</var>
<db:getClobFromResultSet resultSet="rs" field="LDTEXT" row="1" var="resultClob"/>
<db:getBlobFromResultSet>
Gets BLOB value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched Blob value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultBlob" type="Blob">
null
</var>
<db:getBlobFromResultSet resultSet="rs" field="RESOURCES" row="1" var="resultBlob"/>
<db:getBytesFromResultSet>
Gets bytes value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched bytes value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultBytes" type="byte[]">
null
</var>
<db:getBytesFromResultSet resultSet="rs" field="RESOURCES" row="1" var="resultBytes"/>
<db:getByteFromResultSet>
Gets byte value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched byte value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultByte" type="byte">
0
</var>
<db:getByteFromResultSet resultSet="rs" field="ASSETLOCPRIORITY" row="1" var="resultByte"/>
<db:getIntFromResultSet>
Gets integer value from record identified by given row number from given result set.
| Attribute | Required | Description |
|---|---|---|
resultSet |
yes | Name of the result set, must be variable that was obtain with db:sql element. |
field |
yes | Name of the field from which value will be fetched. |
var |
yes | Variable which will hold fetched integer value. |
row |
yes | Row number, starts with 1 |
Example:
<var name="resultInt" type="int">
0
</var>
<db:getIntFromResultSet resultSet="rs" field="ESTMATCOST" row="1" var="resultInt"/>
Network Tags (net:)
Network reachability and HTTP response-code checks.
<net:ping>
Test the reachability of a host on an Internet Protocol (IP) network.
| Attribute | Required | Description |
|---|---|---|
host |
yes | IP address or Computer name whose reachability will be tested. |
Child elements: <net:port>
Example:
<net:ping host="192.168.1.5"/>
For testing reachability of port on a host, you can use <net:port> child element.
Example:
<net:ping host="192.168.1.5">
<net:port>
139
</net:port>
</net:ping>
<net:getURLResponseCode>
Returns response code from given URL.
| Attribute | Required | Description |
|---|---|---|
url |
yes | URL for which response code will be fetched. |
var |
yes | Variable which will hold returned response code (number). |
Example:
<var name="response" type="int">
0
</var>
<net:getURLResponseCode url="http://www.google.com" var="response"/>
<net:checkURLResponseCode>
Test response code for given URL.
| Attribute | Required | Description |
|---|---|---|
url |
yes | URL for which response code will be tested. |
responseCode |
yes | Expected response code. |
Example:
<net:checkURLResponseCode url="http://www.google.com" responseCode="200"/>
System Tags (sys:)
Orchestration and parameters: run other cases/suites, read/write project & system params, share values between runs, logging.
<sys:runCase>
Runs the given case. The case is run synchronously but can be run asynchronously by controlling the value of the runType attribute.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the case to run. |
runType |
no | Type of run : "synchronous" - the script will wait for this test to finish before moving on. "asynchronous" - the script will move on after the run has been initiated. |
var |
yes | Variable to receive run results. Must be of type "CaseRunResult" Example: <var name="runResult1" type="CaseRunResult">null</var> <sys:runCase name="case 1" var="runResult1"/> |
noOfRepeats |
no | How many times to run the case. Default value is 1 |
typeOfRepeatRun |
no | serial - the cases are run one after another parallel - the cases are run all at the same time |
Child elements: <sys:params>
Example:
simple synchronous test run
<sys:runCase name="case 1"/>
:: Example 2: asynchronous run
<sys:runCase name="case 1" runType="asynchronous"/>
:: Example 3: run result is returned into the "runResult1" variable
<var name="runResult1" type="CaseRunResult">null</var>
<sys:runCase name="case 1" var="runResult1"/>
:: Example 4:r un the case with the specific parameters
<sys:runCase name="case 1"/>
<sys:params>
param1=Some value
anotherParam=Some other value
</sys:params>
</sys:runCase>
<sys:runSuite>
Runs the given suite. The suite is run synchronously but can be run asynchronously by controlling the value of the runType attribute.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the suite to run. |
runType |
no | Type of run : "synchronous" - the script will wait for this test to finish before moving on. "asynchronous" - the script will move on after the run has been initiated. |
var |
no | Variable to receive run results. Must be of type "SuiteRunResult" Example: <var name="runResult1" type="SuiteRunResult">null</var> <sys:runSuite name="suite 1" var="runResult1"/> |
Child elements: <sys:params>
Example:
simple synchronous suite run
<sys:runSuite name="suite 1"/>
:: Example 2: asynchronous run
<sys:runSuite name="suite 1" runType="asynchronous"/>
:: Example 3: run result is returned into the "runResult1" variable
<var name="runResult1" type="SuiteRunResult">null</var>
<sys:runSuite name="suite 1" var="runResult1"/>
:: Example 4:r un the suite with the specific parameters
<sys:runSuite name="suite 1"/>
<sys:params>
param1=Some value
anotherParam=Some other value
</sys:params>
</sys:runSuite>
<sys:stopRun>
Stops the run for the given runid.
This is used to stop both case runs and suite runs.
| Attribute | Required | Description |
|---|---|---|
runId |
yes | Run Id. |
Example:
- stop a run with a known id:
<sys:stopRun runId="1256"/>
:: Example 2 - stop a run that was started asynchronously:
<var name="runResult1" type="CaseRunResult">null</var>
<sys:runCase name="case 1" runType="asynchronous" var="runResult1" />
<var name="runId1" type="Long">runResult1.getId()</var>
<sys:stopRun runId="runId1"/>
<sys:setRunProgress>
Updates the run progress percentage in the webapp.
| Attribute | Required | Description |
|---|---|---|
percent |
yes | Completion percentage. |
Example:
<sys:setRunProgress percent="50"/>
<sys:getProjectParam>
Gets project parameter value.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the project parameter. |
var |
yes | Variable that will receive the value of the project parameter. |
Example:
<var name="var1" type="String">null</var>
<sys:getProjectParam name="param.1" var="var1"/>
<sys:getParam>
Gets project parameter value.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the project parameter. |
var |
yes | Variable that will receive the value of the project parameter. |
Example:
<var name="var1" type="String">null</var>
<sys:getProjectParam name="param.1" var="var1"/>
<sys:incrementProjectParam>
Increments project parameter by 1 and retrieves the resulting value.
This helps to create unique values where needed.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the project parameter. |
var |
yes | Variable that will receive the value of the project parameter. |
Example:
<var name="var1" type="String">null</var>
<sys:incrementParam name="param.1" var="var1"/>
<sys:getSystemParam>
Gets system parameter value.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the system parameter. |
var |
yes | Variable that will receive the value of the system parameter. |
Example:
<var name="var1" type="String">null</var>
<sys:getSystemParam name="param.1" var="var1"/>
<sys:getSharedRunValue>
Gets shared run value that was set by a preceding case from within the same batch.
Shared run values are used for information exchange between cases when they are run in the same batch, e.g cases in a suite or cases whose run was initiated from within another case.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the shared run value. |
var |
yes | Variable that will receive the shared run value. |
Example:
... case1 creates a purchase order and sets a shared run value with the purchase order number
<sys:setSharedRunValue name="po.num" value="1234"/>
... case2 reads the purchase order number to use it to approve the PO
<var name="poNum" type="String">null</var>
<sys:getSharedRunValue name="po.num" var="poNum"/>
<sys:setSharedRunValue>
Sets shared run value to be used by other cases from within the same batch.
Shared run values are used for information exchange between cases when they are run in the same batch, e.g cases in a suite or cases whose run was initiated from within another case.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Value name. |
value |
yes | Value to be shared. |
Example:
... case1 creates a purchase order and sets a shared run value with the purchase order number
<sys:setSharedRunValue name="po.num" value="1234"/>
... case2 reads the purchase order number to use it to approve the PO
<var name="poNum" type="String">null</var>
<sys:getSharedRunValue name="po.num" var="poNum"/>
<sys:addLogLine>
Adds a line of text to the run log. The update happens in real time and can be observed in the webapp.
| Attribute | Required | Description |
|---|---|---|
text |
yes | Text to be added as a log line. |
Example:
<sys:addLogLine text="some log text"/>
<sys:addLog>
Appends text to the run log. It doesn't break the line. The update happens in real time and can be observed in the webapp.
| Attribute | Required | Description |
|---|---|---|
text |
yes | Text to be appended. |
Example:
<sys:addLog text="some log text"/>
<sys:getAllProjectParams>
Gets all project parameters.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable that will receive the list of project parameters. Must be of type List<ProjectParam>. |
Example:
<var name="projParams1" type="List<ProjectParam>">null</var>
<sys:getProjectParams var="projParams1"/>
<sys:getAllSystemParams>
Gets all system parameters.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable that will receive the list of system parameters. Must be of type List<ProjectParam>. |
Example:
<var name="sysParams1" type="List<SystemParam>">null</var>
<sys:getSystemParams var="sysParams1"/>
<sys:getAllParams>
Gets all run parameters.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable that will receive the list of run parameters. Must be of type String. |
Example:
<var name="runParams1" type="String">null</var>
<sys:getAllParams var="runParams1"/>
Time Tags (time:)
Stopwatches, waits, and reading/formatting date-time components.
<time:stopwatchStart>
Starts a new timing session. Attribute name represents the name of variable that will hold the stopwatch instance(Variable must be created before using this element and its type must be StopWatch)
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the variable which will hold the stopwatch instance. |
Example:
<var name="stopwatch1" type="StopWatch">
null
</var>
<time:stopwatchStart name="stopwatch1"/>
<time:stopwatchStop>
Stop the stopwatch (ends the timing session) and returns time in millisecond.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the stopwatch (variable which holds the stopwatch instance). |
var |
yes | Variable which will hold returned time. Returned time is in milliseconds and variable which will hold it must have type long. |
Example:
<var name="stop1" type="long">
0
</var>
<time:stopwatchStop name="stopwatch1" var="stop1"/>
<time:stopwatchSplit>
Returns time passed since starting stopwatch. Returned time is in milliseconds.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the stopwatch (variable which holds the stopwatch instance). |
var |
yes | Variable which will hold returned time. Returned time is in milliseconds and variable which will hold it must have type long. |
Example:
<var name="split1" type="long">
0
</var>
<time:stopwatchSplit name="stopwatch1" var="split1"/>
<time:getSeconds>
Transforms milliseconds to seconds.
| Attribute | Required | Description |
|---|---|---|
milliseconds |
yes | Variable which holds milliseconds. |
var |
yes | Variable which will hold returned seconds. |
Example:
<var name="mills" type="long">
2017
</var>
<var type="float" name="sec">
0
</var>
<time:getSeconds milliseconds="mills" var="sec"/>
<time:stopwatchSuspend>
Suspend the stopwatch for later resumption.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the stopwatch (variable which holds the stopwatch instance). |
Example:
<time:stopwatchSuspend name="stopwatch1"/>
<time:stopwatchResume>
Resume the stopwatch after a suspend. The watch will not include time between the suspend and resume calls in the total time.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the stopwatch (variable which holds the stopwatch instance). |
Example:
<time:stopwatchResume name="stopwatch1"/>
<time:wait>
Stops the test thread for a specified number of seconds.
| Attribute | Required | Description |
|---|---|---|
period |
yes | Time frame during which the test thread is stopped(in seconds). |
Example:
<time:wait period="5"/>
<time:getDayOfWeek>
Returns the day of the week. Returned value is number in interval 1-7 (starting with sunday).
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned day of the week (number). |
Example:
<var type="int" name="dayOfWeek">
0
</var>
<time:getDayOfWeek var="dayOfWeek"/>
<time:getDayOfMonth>
Returns the day of the month. Returned value is number.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned day of the month(number). |
Example:
<var type="int" name="dayOfMonth">
0
</var>
<time:getDayOfMonth var="dayOfMonth"/>
<time:getHourOfDay>
Gets the current hour. Returned value is a number.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned hour (number). |
Example:
<var type="int" name="hourOfDay">
0
</var>
<time:getHourOfDay var="hourOfDay"/>
<time:getCurrentMinute>
Returns the number of minutes past the hour.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned minutes. |
Example:
<var type="int" name="minute">
0
</var>
<time:getCurrentMinute var="minute"/>
<time:getMonth>
Returns a number representing the current month. Returned number id in interval 0-11 (starting with January).
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned month (number). |
Example:
<var type="int" name="month">
0
</var>
<time:getMonth var="month"/>
<time:getCurrentSecond>
Returns the number of seconds past the minute.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned seconds (number). |
Example:
<var type="int" name="second">
0
</var>
<time:getCurrentSecond var="second"/>
<time:getYear>
Returns the current year.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned year. |
Example:
<var type="int" name="year">
0
</var>
<time:getYear var="year"/>
<time:getTime>
Returns a Date object representing current time value.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned Date value. |
Example:
<var type="Date" name="time">
null
</var>
<time:getTime var="time"/>
<time:getFormatedTime>
Formats a Date into a date/time string using the given date and time pattern. Returns date/time string. By default it use current system time.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold returned date-time string. |
format |
yes | Date and time pattern. |
Child elements: <time:dateVar>
Example:
<var type="String" name="formatedTime">
null
</var>
<time:getFormatedTime var="formatedTime" format="dd-mm-yyyy hh:mm:ss"/>
If you don't want to use current system time, you can pass the Date instance by using <time:dateVar> child element.
Example:
<time:getFormatedTime var="formatedTime1" format="dd-mm-yyyy hh:mm:ss">
<time:dateVar>
time
</time:dateVar>
</time:getFormatedTime>
<time:addTime>
Adds or subtracts the specified amount of given unit of time to the given Date variable. Variable can be negative.
| Attribute | Required | Description |
|---|---|---|
var |
yes | Variable which will hold Date value to be altered with. |
amount |
yes | Variable which will hold amount of time unit to be added or subtracted. Variable can be negative. |
unit |
yes | Variable which will hold unit of time. Allowed units: MILLISECOND, SECOND, MINUTE, HOUR, DAY, MONTH, YEAR |
Example:
<time:addTime var="currentDate" amount="15" unit="MINUTE" />
Performance Tags (perf:)
Performance measurement segments for timing parts of a test.
<perf:initialize>
Initializes the required parameters for further usage of performance tags. This tag must exist in the script before any other performance tag.
| Attribute | Required | Description |
|---|---|---|
sessionid |
yes | Serves the purpose of tagging and grouping together the performance measurements that belong to the same performance testing session. The value for this attribute will normally be passed from a test parameter, which in turn will be given a unique value before each performance testing session. It is in a free text format. |
Example (synthesised):
<perf:initialize sessionid="..." />
<perf:segmentStart>
Starts a new performance segment. After this tag use perf:segmentSplit... to record split time and perf:segmentStop... to record overall time for the segment.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the of the segment. |
Example (synthesised):
<perf:segmentStart name="..." />
<perf:segmentStop>
Stops time measuring for the segment and stores the time in the database in milliseconds.
| Attribute | Required | Description |
|---|---|---|
name |
yes | Name of the segment. |
description |
yes | Description of the segment |
comment |
yes | Comment to be saved with the record.TODO say a bit more |
Example (synthesised):
<perf:segmentStop name="..." description="..." comment="..." />
<perf:segmentSplit>
Without stopping the segment, takes time measurement for the segment and stores in the database in milliseconds.
| Attribute | Required | Description |
|---|---|---|
segmentName |
yes | Name of the segment. |
splitName |
yes | Name of the split. |
description |
yes | Description of the split. |
comment |
yes | Comment to be saved with the record.TODO say a bit more |
Example (synthesised):
<perf:segmentSplit segmentName="..." splitName="..." description="..." comment="..." />
Tag-Definition Meta Schema (tag:)
Meta-schema used to define custom MXML tags (how a tag maps to generated Java). Not used inside test cases directly.
<tag:tagDefinitions>
Root element of tag definition.
Child elements: <tag:tagDefinition>
Example (synthesised):
<tag:tagDefinitions>
<tag:tagDefinition>...</tag:tagDefinition>
</tag:tagDefinitions>
<tag:tagDefinition>
Root element of tag definition.
| Attribute | Required | Description |
|---|---|---|
name |
no | — |
nameSpace |
no | — |
path |
no | — |
Child elements: <tag:attributes>, <tag:attribute>, <tag:code>, <tag:endCode>, <tag:imports>, <tag:import>, <tag:globals>, <tag:global>, <tag:exceptions>, <tag:exception>
Example (synthesised):
<tag:tagDefinition name="..." nameSpace="...">// code / content here</tag:tagDefinition>