Documentation › MXML Language Reference
MXML Language Reference
MXML (MaxTAF XML) is a compact, tag-based language purpose-built for testing IBM Maximo. It transpiles to Java and runs on Selenium, but hides the boilerplate and handles Maximo's quirks — iframes, dirty-record prompts, required/readonly field validation — behind clean tags like <ui:click> and <ui:assertValue>. Most MXML cases are produced by the recorder or an AI test case; this page is for reading, editing and hand-writing them.
How MXML transpiles
Every MXML tag has an associated Java template defined in MaxTAF's schema (XSD). At run time the engine walks the MXML tree and, for each tag, substitutes its attributes ($attr) and content ($content) into that template, assembling a standard JUnit-style Java test class. Tags that act on an element take one locator child (e.g. <ui:id>) which declares the Selenium By used by the surrounding action.
You don't need to see the Java — but MaxTAF shows it: a case's Script tab has MXML | JAVA sub-tabs so you can author in MXML and inspect the transpiled Java side by side.
The case skeleton
An MXML case is a <testCase> root declaring the namespaces it uses, with three lifecycle blocks. The ui namespace (xmlns:ui="http://www.maxtaf.com/ui") holds the UI/Maximo actions.
<testCase name="MyCaseName"
xmlns="http://www.maxtaf.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ui="http://www.maxtaf.com/ui">
<beforeTestCase>
<initializeApi />
<ui:createDriver>
<ui:timeout>20</ui:timeout>
</ui:createDriver>
<ui:javaScriptExecutor />
<addReporter type="xml" name="Test Title" description="Test Description"
class="Test Class" author="Author" />
</beforeTestCase>
<test name="testMyCaseName">
<addTestReport name="testMyCaseName" />
<ui:maximizeWindow />
<native>driver.get(mxService.getParam("mx.maximo.address"))</native>
<ui:click>
<ui:id>toolactions_INSERT-tbb_anchor</ui:id>
</ui:click>
<ui:clear><ui:id>md3801d08-tb</ui:id></ui:clear>
<ui:sendKeys text="Pump repair"><ui:id>md3801d08-tb</ui:id></ui:sendKeys>
<ui:assertValue value="WAPPR"><ui:id>STATUS@483</ui:id></ui:assertValue>
<testReportStatus>PASSED</testReportStatus>
</test>
<afterTestCase>
<ui:close />
<closeReporter />
</afterTestCase>
</testCase>
- beforeTestCase — set-up: create the API service, the driver and the JS executor, and register the reporter.
- test — the actual steps (this becomes the JUnit test method). End a passing test with
<testReportStatus>PASSED</testReportStatus>. - afterTestCase — teardown: close the browser and flush the report.
The report status starts as FAILED. A failed assertion keeps it FAILED and fails the test; a clean run sets it to PASSED at the end, and <closeReporter/> writes the final value.
Structural & reporting tags
| Tag | Purpose |
|---|---|
<testCase name> | Root element; declares namespaces. |
<beforeTestCase> / <afterTestCase> | Set-up / teardown blocks. <beforeTest> / <afterTest> are per-test hooks. |
<test name> | The test body (a JUnit test method). |
<initializeApi/> | Sets up the MaxTAF API service (mxService). |
<addReporter name description class author type> | Registers the test reporter. |
<addTestReport name> | Starts a report section and its step counter. |
<addReportLine action expected actual status> | Adds a narration line to the report. |
<testReportStatus>PASSED</testReportStatus> | Sets the overall status (put at the end of a passing test). |
<closeReporter/> | Flushes the final status to the report. |
<var name type>value</var> | Declares a test variable ($type $name = value;). |
<native>…</native> | Escape hatch — injects raw Java verbatim. See below. |
Selector (locator) model
An action tag contains exactly one locator child, which becomes a Selenium By. Supported locators, in the recorder's preference order:
| Locator | Becomes |
|---|---|
<ui:id>value</ui:id> (preferred) | By.id(value) |
<ui:cssSelector>value</ui:cssSelector> | By.cssSelector(value) |
<ui:xpath>value</ui:xpath> | By.xpath(value) |
<ui:linkText>value</ui:linkText> | By.linkText(value) |
<ui:name>value</ui:name> | By.name(value) |
<ui:tagName>value</ui:tagName> | By.tagName(value) |
<ui:click>
<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
</ui:click>
<ui:className>The recorder may fall back to a <ui:className> selector, but the engine does not support it — a case using it will not compile. Replace it with an id, cssSelector or xpath.
Interaction actions
| Tag | Attributes | Purpose |
|---|---|---|
<ui:click> | — | Click an element (scrolls into view first). |
<ui:clickSimple> | — | Fire a native click event. |
<ui:doubleClick> | — | Double-click. |
<ui:clickError> | — | Click the error icon inside a Maximo field. |
<ui:clickEvent> | — | Fire Maximo's internal sendEvent for the element. |
<ui:sendKeys text> | text | Type text into a field. Use with a preceding <ui:clear>. |
<ui:clear> | — | Clear a text field. |
<ui:mouseOver> | — | Hover over an element. |
<ui:executeScript jsCode> | jsCode | Run JavaScript on the page. |
<ui:executeScriptOnTarget jsCode> | jsCode | Run JavaScript with the located element as arguments[0]. |
<ui:setInnerHTML> | — | Set an element's innerHTML (content child). |
<ui:maximizeWindow/> | — | Maximise the browser window. |
<ui:screenshot/> | — | Capture a screenshot into the report. |
Assertions & verifies
Assert tags fail the test immediately on mismatch. Verify tags are non-blocking — they collect verification errors and let the test continue.
| Assert (blocking) | Verify (non-blocking) | Checks |
|---|---|---|
<ui:assertValue value> | <ui:verifyValue value> | An input field's value. |
<ui:assertText text> | <ui:verifyText text> | An element's text. |
<ui:assertTitle title> | <ui:verifyTitle title> | The page title (no locator). |
<ui:assertElementPresent> | <ui:verifyElementPresent> | The element exists. |
<ui:assertElementRequired> | — | A Maximo field is marked required. |
<ui:assertElementReadonly> | — | A field is read-only. |
<ui:assertElementError> | — | A field shows an error state. |
<ui:assertTextPresent text> | <ui:verifyTextPresent text> | Text appears anywhere on the page. |
The Maximo-aware asserts (Required, Readonly, Error) are what make MXML valuable for Maximo: they check the field states Maximo exposes rather than raw DOM attributes.
Storing values in variables
Store tags read something into a variable you can reuse later in the case (e.g. capture a generated work-order number, then assert it downstream).
| Tag | Purpose |
|---|---|
<ui:getValue var> | Store an input's value (recorder calls this storeValue). |
<ui:getText var> | Store an element's text (storeText). |
<ui:getTitle var> | Store the page title (storeTitle). |
<ui:getAttribute name var> | Store a named attribute's value. |
<ui:getElementPresent var> | Store a boolean — is the element present. |
<ui:getVerificationErrors> | Emit report lines for all collected verify errors. |
The recorder declares the variable first, e.g. <var name="WO_NUM" type="String">""</var>, then the <ui:getValue var="WO_NUM"> tag fills it.
Waits
| Tag | Purpose |
|---|---|
<ui:waitForElementPresent> | Wait until an element appears (the recorder auto-adds this after menu-toggle clicks). |
<ui:waitForText text> / <ui:waitForValue value> | Wait until an element's text / an input's value equals a target. |
<ui:waitForTitle title> / <ui:waitForTextPresent text> | Wait for a page title / text anywhere on the page. |
<ui:wait>3</ui:wait> | Sleep a fixed number of seconds (use sparingly). |
<ui:pause/> / <ui:waitForUserAction> | Pause for manual "Continue" / prompt the user (exploratory mode). |
Maximo, frames & windows
These tags encapsulate Maximo-specific flows. Many are available for hand-authoring even though the recorder captures the underlying clicks instead.
| Tag | Purpose |
|---|---|
<ui:createDriver> + <ui:timeout> | Open the browser/driver with an implicit-wait timeout (in beforeTestCase). |
<ui:javaScriptExecutor/> | Enable JavaScript execution. |
<ui:login> (+ <ui:userName>/<ui:password>) | Log in; falls back to mx.maximo.username/password params if omitted. |
<ui:logout/> | Log out. |
<ui:openApp name> / <ui:changeApp name> | Open / switch to a Maximo application. |
<ui:switchToFrame> / <ui:switchToDefaultFrame/> | Enter an iframe / return to the top frame. Maximo's main content is in #manage-shell_Iframe; the tag retries via the parent frame on timeout. |
<ui:switchToWindow title closeCurrent> / <ui:switchToMainWindow closeCurrent> | Switch browser windows/tabs by title. |
<ui:sendParam name> | Type a named test parameter's value into a field. |
<ui:close/> | Screenshot on failure, log out, quit the driver (in afterTestCase). |
Special values & the native escape hatch
$ENTER— as thetextof<ui:sendKeys>, sends the Enter key rather than literal text (other SeleniumKeys.*tokens work too). The recorder omits the preceding<ui:clear>in this case.- Variable interpolation — in
String-typed attributes/content,${expr}and$varsplice a Java expression/variable into the string. InExpression-typed content the leading$is simply stripped (raw Java). Escape a literal dollar as\$. - Navigation — MXML has no dedicated navigate tag; the recorder emits
<native>driver.get("https://…")</native>, or<native>driver.get(mxService.getParam("mx.maximo.address"))</native>to navigate to whatever the Maximo-address parameter holds. <native>— drops into raw Java verbatim. Inside it you havedriver(the Maximo web driver),bot(UI helper),js(JS executor) andmxService(the API). Use it when no tag fits.
<ui:sendKeys text="$ENTER"><ui:id>searchField</ui:id></ui:sendKeys>
<native>
System.out.println("Custom step: " + mxService.getParam("mx.maximo.address"));
</native>
Parameters in MXML
- Read a parameter at run time with
mxService.getParam("name")(inside<native>or a tag that uses it). - Driver/connection behaviour comes from parameters:
mx.selenium.server,mx.selenium.mode,mx.selenium.browser,mx.selenium.slow_down_level,mx.selenium.enable_video_recording, andmx.maximo.address/mx.maximo.username/mx.maximo.password. <ui:sendParam name>types a named test parameter's value straight into a field.- Project-level and case-level parameters both apply; case-level values override project-level ones. See the Parameter reference.
Gotchas & tips
- Prefer stable locators. Maximo generates volatile element ids; where possible use an
idthat carries a meaningful suffix (e.g.STATUS@483) or a robustcssSelector/xpath. Avoid<ui:className>(unsupported). - Frame awareness. After navigating into Maximo content you're inside an iframe. The recorder inserts
<ui:switchToFrame>automatically; when hand-writing, switch frames before acting and back with<ui:switchToDefaultFrame/>. - The recorder emits a subset. It doesn't generate every tag (e.g.
login,openApp,screenshot,getAttribute) — but the engine supports them all, so you can add them by hand. - Other namespaces exist. Alongside
ui, MaxTAF definestime,net,db,systemandperfnamespaces for timing, HTTP, database, system and performance operations — declare and use them the same way.