Table of Contents

Developer's Guide

for MaxTAF 3.0.0

What This Manual Covers


This manual describes how to create MaxTAF tests.

Before you start reading this guide, you should be familiar with MaxTAF basics as laid out in the "MaxTAF User's Guide".


There are generally, three types of MaxTAF tests:

  1. JUnit Tests
  2. MXML Tests
  3. UI Tests

JUnit tests are the fundamental types of tests for MaxTAF framework. JUnit is a framework for creating unit tests for Java based applications. JUnit tests are themself written in the Java language, hence Java skills are a prerequisite for creating such MaxTAF tests.

MXML tests use MaxTAF proprietary XML language for writing/configuring tests. MXML is a library of XML elements/tags that specialize in specific testing activities. Additionally, MXML provides elements that allow flow control (if-then-else), tags that work with variables, and other similar functionality that is required for advance scripting/programming.

UI tests utilize the open source Selenium framework, that enables browser automation tasks. Typically, the UI test will first be recorded (e.g. you will record a Maximo session) using a Firefox add-on called Selenium IDE. The recording will then be converted to MaxTAF (either to MXML or to JUnit). Thereafter you can run the recording like any other MaxTAF tests with a difference that, instead of working in the background like ordinary JUnit or MXML test, a browser will be launched and the recorded session will be repeated without human involvement.


JUnit Overview

JUnit is a testing framework for Java programming language. There is an abundance of resources, documentation and training material for JUnit, both online and off-line, starting with the JUnit official web site at http://www.junit,org.  This guide will only present a very brief overview and the developer is encouraged to explore JUnit further.

MaxTAF for Maximo version 7.x and higher implements JUnit 4, which in turn uses annotation style programming.

In its simplest form, a JUnit 4 test requires import of the JUnit package and a method annotated as @Test:

			
	package rs.cdl.maxtaf.miftest;

	import static org.junit.Assert.assertFalse;
	import java.rmi.RemoteException;
	import org.junit.Test;
	import psdi.server.*;
	import psdi.util.MXException;

	public class TestAdminMode {
		@Test
		public void testAdminModeSwitchedOff() throws RemoteException, MXException {
			assertFalse("Result", MXServer.getMXServer().isAdminModeOn(true));
		}
	}
			
	

The table below shows JUnit annotation:

Table 1. Annotations

Annotation Description
@Test public void method() The annotation @Test identifies that a method is a test method.
@Before public void method() Will execute the method before each test. This method can prepare the test environment (e.g. read input data, initialize the class).
@After public void method() Will execute the method after each test. This method can cleanup the test environment (e.g. delete temporary data, restore defaults).
@BeforeClass public void method() Will execute the method once, before the start of all tests. This can be used to perform time intensive activities, for example to connect to a database.
@AfterClass public void method() Will execute the method once, after all tests have finished. This can be used to perform clean-up activities, for example to disconnect from a database.
@Ignore Will ignore the test method. This is useful when the underlying code has been changed and the test case has not yet been adapted. Or if the execution time of this test is too long to be included.
@Test (expected = Exception.class) Fails, if the method does not throw the named exception.
@Test(timeout=100) Fails, if the method takes longer than 100 milliseconds.

The following table shows various test methods you can use in JUnit:

Table 2. Test methods

Statement Description
fail(String) Let the method fail. Might be used to check that a certain part of the code is not reached. Or to have failing test before the test code is implemented.
assertTrue(true) / assertTrue(false) Will always be true / false. Can be used to predefine a test result, if the test is not yet implemented.
assertTrue([message], boolean condition) Checks that the boolean condition is true.
assertsEquals([String message], expected, actual) Tests that two values are the same. Note: for arrays the reference is checked not the content of the arrays.
assertsEquals([String message], expected, actual, tolerance) Test that float or double values match. The tolerance is the number of decimals which must be the same.
assertNull([message], object) Checks that the object is null.
assertNotNull([message], object) Checks that the object is not null.
assertSame([String], expected, actual) Checks that both variables refer to the same object.
assertNotSame([String], expected, actual) Checks that both variables refer to different objects.

MXML tests use MaxTAF proprietary XML language for writing/configuring tests. MXML is a library of XML elements/tags that specialize in specific testing activities. Additionally, MXML provides elements that allow flow control (if-then-else), tags that work with variables, tags for reporting and other similar functionality that is required for advance scripting/programming.

	
	<?xml version="1.0" encoding="ISO-8859-1"?>

	<testCase name="AdminModeXML" xmlns="http://www.maxtaf.com">
		
		<beforeTestCase>
			<addReporter type="xml" name="AdminModeXML" description="Testing for Admin Mode" class="" author="author" />
		</beforeTestCase>
		
		<test name="NewMIFTest">
			
			<addTestReport name="Test1" />
			<isAdminModeOff />
			<addReportLine action="Checking Admin Mode" expected="Admin Mode Off" actual="Admin Mode Off" status="PASSED" />
			
			<testReportStatus>PASSED</testReportStatus>
		
		</test>
		
		<afterTestCase>
			<closeReporter />
		</afterTestCase>
	</testCase>
			
	

Example MXML test script

Like all well formed XML documents, MXML should start with the xml tag:

			
	<?xml version="1.0" encoding="ISO-8859-1"?>

	...
			
	

This is immediately followed by the root element which is testCase where you name the test case and specify name spaces:

			
	<?xml version="1.0" encoding="ISO-8859-1"?>

	<testCase name="AdminModeXML" xmlns="http://www.maxtaf.com">
		
		<beforeTestCase>
			<addReporter
	...
			
	

The first element within the testCase is called beforeTestCase and is used to initialize test case-wide parameters, like the reporter:

			
	...

	<testCase name="AdminModeXML" xmlns="http://www.maxtaf.com">
		
		<beforeTestCase>
			<addReporter type="xml" name="AdminModeXML"   description="Testing for Admin Mode" class="" author="author" />
		</beforeTestCase>

	...
			
	

Then you have the main element called test and that is where all the logic of the test is contained.  Depending on your license, you can have one or many test tags in your test script.

			
	...

	</beforeTestCase>
		
	<test name="NewMIFTest">
		
		<addTestReport name="Test1" />
		<isAdminModeOff />
		<addReportLine action="Checking Admin Mode" expected="Admin Mode Off" actual="Admin Mode Off" status="PASSED" />
		<testReportStatus>PASSED</testReportStatus>
		
	</test>

	<afterTestCase>
		...
			
	

The last tag is always afterTestCase, used for the clean-up:

			
	...

		</test>
		
		<afterTestCase>
			
			<closeReporter />
		
		</afterTestCase>

	</testCase>
			
	

testCase

testCase is the root element for MXML tests, meaning that every MXML test must start with this element. testCase element has the following attributes:

name

This attribute must be the same as the name of the Test File that you have specified for this test.

xmlns

Namespace attribute. Must have at least xmlns="http://www.maxtaf.com".  

If you are planning to use extended functionality in specialized name spaces, then each of these name spaces needs to be listed here e.g xmlns:ui="http://www.maxtaf.com/ui".    

Example:

			
	<?xml version="1.0" encoding="ISO-8859-1"?>

	<testCase name="ImportWO_HTTP_EJB" xmlns="http://www.maxtaf.com" xmlns:ui="http://www.maxtaf.com/ui" xmlns:mif="http://www.maxtaf.com/mif" xmlns:mbo="http://www.maxtaf.com/mbo">

		...

	</testCase>
				
			

beforeTestCase

After you have specified the root element, your next element will be beforeTestCase. The purpose of this element is to perform the initial setting of the test run. Typically, this is the place where you will initialize your test report using the element addReporter.

Example:

				
	<beforeTestCase>
		
		...
		
	</beforeTestCase>
				
			

addReporter

To use the built-in reporting facilities in your MXML test, you must specify the addReporter tag within the beforeTestCase tag. The addReporter element has the following attributes:

type

Type of report: simple or xml.

simple type produces a non-formated text output, like a text file.

xml type produces a web-page style report. See <<report>> section for further details.

name

The name that appears in the heading of the report

description

Description that appears in the heading of the report

class

Name of the test class or file in the heading

author

Name of the author

Example:

				
	<addReporter type="xml" name="TestNewFlatStructure" description="Testing new flat structure" class="rs.cdl.xmltests.FlatStructureTesting.java" author="DD"/>
				
			

This will produce the following output:

test

This element contains the actual test script. All of the test scenario actions are defined within this element. The test element has the following attributes:

name

Unique name for the test - required

id

Optional test id

addTestReport

This is a mandatory element that instantiates individual test report. This element must be located at the top of the test element.

The test element has the following attributes:

name

Test report name

Example:

				
	<test name="NewMIFTest">

		<addTestReport name="Test1" />
				
			

addReportLine

This element adds a line to the test report.

The addReportLine element has the following attributes:

action

Text for the action segment

expected

Text for the expected segment

actual

Text for the actual segment

status

Text for the status segment

Example:

				
	<addReportLine action="Getting work order from database" expected="Finding work order with description: Testing import of WO 1" actual="Work order not found" status="FAILED"/>
				
			

afterTestCase

This needs to be the last element within your testCase tag. Use this element to perform clean up operations like closing the report.

MXML element library consists of tags which are grouped into several categories:

General MXML tags - these tags deal with the general test behavior and logic. They are used to control the general flow of the test, for example what happens before and after the start of the test, what happens after the test has completed.

MBO tags - these tags are used for direct MBO interaction. They can be used to invoke or query MBO logic.

MIF tags - these tags are used for the Maximo integration framework interaction. They can be used to invoke MIF related logic, for example to check the external system, enterprise services, publish channels, object structures, cron tasks etc.

UI tags - these tags are used to interact with elements which can be seen on the screen and are needed to run Selenium based tests. They can be used to check HTML elements, text, perform clicks on the page, populate and clear text input elements, open Maximo applications, take screenshots etc.

DB tags - these tags are used to perform database related transactions. They can be used to open and close connection to the DB, to fetch results, loop through results etc.

NET tags - these tags are used to perform basic network related operations. They can be used to ping hosts with IP addresses, get response code from specific URL etc.

TIME tags - these tags deal with time related functionality. They can be used to measure time intervals, get current date, month, hours, minutes etc.

WF tags - these tags are used for Maximo workflow management. They can be used to initiate, complete or stop workflows, check for user's assignments etc.

 

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.

Example:

<addReporter type="xml" name="Create Company Master" description="Testing Company Master application functionality" 	class="rs.cdl.maxtaf.test.CompanyMasterTestUI" author="John" />

Attributes

Name Type Description
type xsd:string 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 user 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 outpuit
name xsd:string Name of the reporter.
description xsd:string Description.
class xsd:string The name of the Junit class of the MaxTAF test.
author xsd:string Author of the test.
addReportLine

Adds a report line to the test report.

Example:

<addReportLine action="$titleText" expected="Company Master application is opened" actual="Company Master application is opened" status="PASSED" />

Attributes

Name Type Description
action xsd:string Describes the test action, e.g. "Approve Work Order".
expected xsd:string Describes the expected ouitcome of the action. E.g. "Work Order Approved".
actual xsd:string States the actual outcome. E.g. "Work Order not approved."
status xsd:string Status of the this test action. Normally it is "PASSED" or "FAILED".
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.

Example:

<addTestReport name="createCompanyMaster" />

Attributes

Name Type Description
name xsd:string Name of the Report.
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 pocessing within the tag will be executed/repeated after the completion of any of the test tags in the test case.

Example:

<afterTest>
	<mif:removeListener/>
</afterTest>
afterTestCase Contains any processing that is required to be executed after the test case is completed.
apiInput

Used for exchanging values between test cases in a suite.

Takes on the value of the "apiOutput" tag from the preceeding test case in a test suite and assignes it to the variable specified in the "var" attribute.

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"/>
....
			

Attributes

Name Type Description
var xsd:string Name of the variable that will be assigned the value of the apiInput.
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.

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"/>
....
			

Attributes

Name Type Description
var xsd:string Name of the variable that will be assigned the value of the apiInput.
assertEquals

Fails the test if 2 objects are not same.

Example:



	  <var type="int" name="actualValue">123</var>
	  
	  <assertEquals expected="123" actual="$actualValue">
		  <assertMessage>Value is not correct. Expected value is 123</assertMessage>
	  </assertEquals>

Attributes

Name Type Description
expected string Expected object value
actual string Actual object value
assertFail

Unconditionaly fails the test.

If the optional subelement "assertMessage" is present, the value of this element will be displayed as the failure explanantion.

Example:


...
<if condition="mboRemoteWO=null">
	<assertFail>
		<assertMessage> Work Order not found</assertMessage>
	</assertFail>
</if>	
assertFalse

Asserts whether the condition is false.

If the condition is true, the test fails.

Example:


<assertFalse condition="1==2"/>

Attributes

Name Type Description
condition xsd:string 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'/>
assertNotNull

Checks that the object is not null.

Object can be of any Java type.

Example:


<var name="myString" type="String">"Test"</var>
<assertNotNull object="myString">
	<assertMessage>Object is null. Test failed.</assertMessage>
</assertNotNull>  

Attributes

Name Type Description
object xsd:string Object for which the null state is asserted. Can be any Java type object.
assertNotSame

Checks that both variables refer to different objects.

Must contain both unexpected and actual attributes, then compares the two.

If they are referrencing different objects, returns true else returns false.

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> 

Attributes

Name Type Description
unexpected xsd:string Object which is not expected to be the same as the actual object.
actual xsd:string Object to check against.
assertNull

Checks that the object is null.

Object can be of any Java type.

Example:


<var name="myString" type="String">"Test"</var>
<assertNull object="myString">
<assertMessage>Object is not null. Test failed.</assertMessage>
</assertNull> 

Attributes

Name Type Description
object xsd:string Object to be checked for null. Can be any Java object type, e.g. String, int etc.
assertSame

Checks that both variables refer to the same object.

Variables can be of any Java type.

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> 

Attributes

Name Type Description
expected xsd:string Object which is expected to be the same as the actual object. Can be of any Java type.
actual xsd:string Object to check against. Can be of any Java type.
assertTrue

Asserts whether the condition is true.

Displays assertMessage on failure.

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>  

Attributes

Name Type Description
condition xsd:string This is a logical expression. It must follow Java format for boolean expressions. Example: 1) String compare &lt;assertFalse condition='myString.equals(&quot;ABC&quot;)'/&gt; 2) Number compare &lt;assertTrue condition='myInt == 15'/&gt;
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.

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>
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>
dowhile

Executes code conditionally until the condition is no longer met.

Example:


<var name="a" type="int">1</var>
<dowhile condition="a < 10">
	<set variable="a">a+1</set>
</dowhile>  

Attributes

Name Type Description
condition xsd:string This is a logical expression that is evaluated for every iteration of the loop. It must follow Java format for boolean expressions.
else

Used only with existing <if> tag.

Executes code in case the <if> tag condition is not met.

Note: This element must be positioned immediatelly 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>

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" />
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:

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>

Attributes

Name Type Description
object xsd:string Java object to perform action on
method xsd:string Java method to execute
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:

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" />

Attributes

Name Type Description
object xsd:string Java object to perform action on
method xsd:string Java method to execute
var xsd:string Variable for storing result of execution
fileToString

Reads file content and stores it into the String variable.

Example:


<fileToString filePath="C:/temp/tmp.csv" var="myVar" />

Attributes

Name Type Description
filePath xsd:string Absolute file path.
var xsd:string Variable that will hold the content of the file as String.
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.

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>

Attributes

Name Type Description
iterator xsd:string Iterator value. Example: "int i = 0"
condition xsd:string Condition for the loop. Example: "i < 10" "i <= 10"
iteration xsd:string Iteration expression. Example: "i++" "i--"
getMaxtafProperty Gets the value of MaxTAF property and puts it in varible.

Attributes

Name Type Description
name xsd:string Name of MaxTAF property which value we want to get.
var xsd:string Variable into which property value will be stored.
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.

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" />

Attributes

Name Type Description
name xsd:string Name of the test parameter
variable xsd:string Test variable to store value to.
globals

Used do define global variables.

Global variables are visible in all tests in test case.

Example:

<testCase>
	<globals>
		<var type="String" name="var1">"Variable 1"</var>
		<var type="int" name="var2">1001</var>
	</globals>
	...
if

Executes content if the condition is true.

Example:


<var name="myInt" type="int">1</var>
<if condition="myInt==1">
	<addReportLine action="ifTest" expected="if Triggered" actual="if Triggered" status="PASSED" />
</if>

Attributes

Name Type Description
condition xsd:string This is a logical expression that is evaluated. It must follow Java format for boolean expressions.
imports

Imports additional Java classes and packages.

The Java classes and packages are specified in children <import> elements.

Example:


<imports>
	<import>
		java.lang.Exception
	</import>
	<import>
		rs.cdl.util.*
	</import>
</imports>

include

Use this tag when you want 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 insted of repeating the same code over and over.

This approach lets you maintain this common code in one file only.

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.

Attributes

Name Type Description
path xsd:string Path to a XML file to include.
incrementProperty Increments the value of MaxTAF property in thread-safe manner.

Attributes

Name Type Description
name xsd:string Name of MaxTAF property which will be incremented. Must be long valu
var xsd:string Variable into which incremented value will be stored.
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>
isAdminModeOff

Checks if Maximo Admin mode is OFF.

Example:


<isAdminModeOff />
isAdminModeOn

Checks if Maximo Admin mode is ON.

Example:


<isAdminModeOn />
print

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.

Example:


<printOut>"Company master name is "+compMasterName</printOut>
<printErr>"There is no work order with num: "+wonum</printErr>

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.

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>

Attributes

Name Type Description
action xsd:string Name of action to perform
expected xsd:string Expected results
failActual xsd:string String to show if test failed
passActual xsd:string String to show if test passed
failStatus xsd:string Status if test failed
passStatus xsd:string Status if test passed
set

Assignes 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" attribut.

Note: the resulting type of the expression must be compatible with the type of the variable, otherwise you will get a type mismatch.

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>
setTestParam

Sets a specific run parameter value of the Test.

Parameters are defined in the Maximo front-end Test application.

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" />

Attributes

Name Type Description
name xsd:string Name of test paramater
value xsd:string Value to store
stringReplace

Replaces substring in the String variable with another substring.

Example:


<stringReplace var="myString" replace="tbl" with="table" />

Attributes

Name Type Description
replace xsd:string Value to be replaced.
with xsd:string New value to be set.
var xsd:string Variable holding the value that will be modified.
stringToFile

Writes into file the content of the String variable.

Example:


<stringToFile content="$myText" filePath="C:/temp/tmp.csv" />

Attributes

Name Type Description
filePath xsd:string Absolute file path.
content xsd:string Content that will be saved into the file.
test

Contains the actual test processing.

This is the main test element in which you perform all of the test processing.

Example:


<test name="ifTest">
	</test>

Attributes

Name Type Description
name xsd:string Test name
id xsd:string Test id
testCase

Root element of MXML.

Test case is the collection of all related tests into one logical group.

Example:


<testCase name="WOAPPRTest" xmlns="http://www.maxtaf.com" xmlns:mif="http://www.maxtaf.com/mif">

Attributes

Name Type Description
id xsd:string ID of the testCase.
name xsd:string Name of the test case. Must be the same as the name of the file to which this test case is saved.
testReportStatus

Sets report status.

Report status will be set to the element value.

Example:


<testReportStatus>PASSED</testReportStatus>
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.

Example:

<var type="String" name="orgId">"EAGLENA"</var>

while

Repeats the processing of its content until the condition becomes false.

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>

Attributes

Name Type Description
condition xsd:string This is a logical expression that is evaluated. It must follow Java format for boolean expressions.

 

mbo:forEach

Iterates over MBO set held in variable 'mboSet'

Creates two local variables - 'currentMbo' and 'currentMboIndex'.

'currentMbo' holds the current MBO in the iteration and 'currentMboIndex' current position.

Example:


<test name="testForEachSimple">

	<var type="MboSetRemote" name="woSet">null</var>

	<mbo:getSet objectName="WORKORDER" var="woSet">
		<mbo:where>
			PARENT = '1000'
		</mbo:where>
	</mbo:getSet>
		
	<mbo:forEach mboSet="woSet">
		<mbo:getStringAttributeValue name="WONUM" mbo="currentMbo" var="woNum" />
	</mbo:forEach>

</test>

Attributes

Name Type Description
mboSet xs:string Variable which holds the MBO set for iteration.
mbo:duplicate

Duplicates MBO. Does the same thing as 'Duplicate' action from 'Select Action' menu in Maximo applications.

Example:


<test name="testSimpleDuplicate">

	<var type="MboRemote" name="mboOriginal">null</var>
	<var type="MboRemote" name="mboDuplicated">null</var>

	<mbo:get objectName="WORKORDER" var="mboOriginal">
		<mbo:where>
		WONUM = '1000'
		</mbo:where>
	</mbo:get>

	<mbo:duplicate var="mboDuplicated" original="mboOriginal" />

	<assertNotNull object="mboDuplicated">
		<assertMessage> Work order not duplicated. Test failed.</assertMessage>
	</assertNotNull>

</test>

Attributes

Name Type Description
var xs:string Variable which will hold the duplicated MBO
original xs:string Variable which holds the MBO to duplicate
mbo:get

Retrieves 'objectName' MBO into variable 'var'.

<parent>, <relationship> and <where> child elements serve as filters.

If <parent> and <relationship> elements are specified then the resulting MBO will be the child of the that parent based on the relationship specified.

If <where> element is defined it will be applied while fetching the MBO.

Example:


<test name="testMboGetSimple">

	<var type="MboRemote" name="wo">null</var>
	<var type="MboRemote" name="woActivity">null</var>

	<!-- Get work order with wonum = '1000' -->
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			wonum = '1000'
		</mbo:where>
	</mbo:get>

	<!-- Get task which has wonum = '1000-20' and which is a child of work order referenced 
		by 'wo' variable and 'parent=:wonum and siteid=:siteid' relationship -->
	<mbo:get objectName="WOACTIVITY" var="woActivity">
		<mbo:parent var="wo">
			<mbo:relationship>
				parent=:wonum and siteid=:siteid
			</mbo:relationship>
		</mbo:parent>
		<mbo:where>
			wonum = '1000-20'
		</mbo:where>
	</mbo:get>

</test>

Attributes

Name Type Description
objectName xs:string Name of MBO object
var xs:string Variable in which the fetched MBO will be held
mbo:getBooleanAttributeValue

Retrieves the boolean value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a "." notation (for example, ASSET.CHILDREN when the 'mbo' variable is WorkOrder ),

this command first gets the correct object and then retrieves the boolean value of the attribute from it.

In the ASSET.CHILDREN case, the appropriate object to retrieve the boolean value of CHILDREN from should not be "WorkOrder".

Rather, it should be an asset object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attibute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:


<test name="testGetBooleanSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="boolean" name="isTask">true</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getBooleanAttributeValue name="ISTASK" mbo="wo" var="isTask" />
		
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getByteAttributeValue

Retrieves the byte value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

Example:


<test name="testGetByteSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="byte" name="assetPriority">0</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getByteAttributeValue name="ASSETLOCPRIORITY" mbo="wo" var="assetPriority" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getDateAttributeValue

Retrieves the date value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a "." notation (for example, ASSET.STATUSDATE when the 'mbo' variable is WorkOrder),

this command first gets the correct object and then retrieves the date value of the attribute from it.

In the asset.STATUSDATE case, the appropriate object to retrieve the date value of STATUSDATE from should not be "WorkOrder".

Rather, it should be an asset object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attibute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:


<test name="testGetDateSimple">

	<var type="MboRemote" name="wo">null</var>
		
	<var type="java.util.Date" name="statusDate">null</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getDateAttributeValue name="STATUSDATE" mbo="wo" var="statusDate" />
		
</test>	

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getDoubleAttributeValue

Retrieves the double value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a . notation (for example, ASSET.TOTALCOST when the 'mbo' variable is WorkOrder ),

this method first gets the correct object and then retrieves the double value of the attribute from it.

In the ASSET.TOTALCOST case,

the appropriate object to retrieve the double value of TOTALCOST from should not be "WorkOrder".

Rather, it should be an ASSET object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:

	
<test name="testGetDoubleSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="double" name="assetPriority">0</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getDoubleAttributeValue name="ASSETLOCPRIORITY" mbo="wo" var="assetPriority" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getFloatAttributeValue

Retrieves the float value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a . notation (for example, ASSET.TOTALCOST when the 'mbo' variable is WorkOrder ),

this method first gets the correct object and then retrieves the float value of the attribute from it.

In the ASSET.TOTALCOST case,

the appropriate object to retrieve the float value of TOTALCOST from should not be "WorkOrder".

Rather, it should be an ASSET object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:

	
<test name="testGetFloatSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="float" name="assetPriority">0</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getFloatAttributeValue name="ASSETLOCPRIORITY" mbo="wo" var="assetPriority" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getIntegerAttributeValue

Retrieves the integer value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a . notation (for example, ASSET.TOTALCOST when the 'mbo' variable is WorkOrder ),

this method first gets the correct object and then retrieves the integer value of the attribute from it.

In the ASSET.TOTALCOST case,

the appropriate object to retrieve the integer value of TOTALCOST from should not be "WorkOrder".

Rather, it should be an ASSET object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:

	
<test name="testGetIntegerSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="int" name="assetPriority">0</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getIntegerAttributeValue name="ASSETLOCPRIORITY" mbo="wo" var="assetPriority" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getLongAttributeValue

Retrieves the long value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a . notation (for example, ASSET.TOTALCOST when the 'mbo' variable is WorkOrder ),

this method first gets the correct object and then retrieves the long value of the attribute from it.

In the ASSET.TOTALCOST case,

the appropriate object to retrieve the long value of TOTALCOST from should not be "WorkOrder".

Rather, it should be an ASSET object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:

	
<test name="testGetLongSimple">
		
	<var type="MboRemote" name="wo">null</var>
	<var type="long" name="assetPriority">0</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getLongAttributeValue name="ASSETLOCPRIORITY" mbo="wo" var="assetPriority" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getSet

Retrieves 'objectName' MBO set into variable 'var'.

<parent>, <relationship> and <where> child elements serve as filters.

If <parent> and <relationship> elements are specified then the resulting MBO set will be the child of the that parent based on the relationship specified.

If <where> element is defined it will be applied while fetching the MBO set.

Example:


<test name="testMboGetSet">

	<var type="MboSetRemote" name="woSet">null</var>

	<mbo:getSet objectName="WORKORDER" var="woSet">
		<mbo:where>
			PARENT = '1000'
		</mbo:where>
	</mbo:getSet>

</test>

Attributes

Name Type Description
objectName xs:string Object name for which set is needed
var xs:string Variable for storing mbo set
mbo:getStringAttributeValue

Retrieves the string value of the attribute identified by 'name' within the MBO held in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a . notation (for example, ASSET.TOTALCOST when the 'mbo' variable is WorkOrder ),

this method first gets the correct object and then retrieves the string value of the attribute from it.

In the ASSET.TOTALCOST case,

the appropriate object to retrieve the string value of TOTALCOST from should not be "WorkOrder".

Rather, it should be an ASSET object obtained from the relationship "ASSET" where workorder.assetnum=asset.assetnum.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to retrieve information from.

Example:

	
<test name="testGetStringSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="String" name="description">
		"Testing mbo:getStringAttributeValue"
	</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:getStringAttributeValue name="DESCRIPTION" mbo="wo" var="description" />
		
</test>

Attributes

Name Type Description
name xs:string Attribute name
mbo xs:string Variable which holds the MBO reference.
var xs:string Variable in which retrieved attibute value will be stored.
mbo:getUniqueValue

Generates the unique String value with prefix 'prefix' within MBO 'object for the attribute 'attribute' and stores it into a variable 'var'.

Note that this command isn't thread safe. If thread safe command is needed, use <incrementProperty> command.

Example:


<test name="testGetUniqueSimple">
		
	<var type="String" name="woNum">""</var>
		
	<mbo:getUniqueValue attribute="WONUM" object="WORKORDER" var="woNum" prefix="TEST"/>
	
</test>	

Attributes

Name Type Description
prefix xs:string Prefix of unique value
object xs:string Object name
attribute xs:string Attribute name for which unique value is generated
var xs:string Variable in which the unique value will be stored
mbo:parent

Child of <mbo:get> and <mbo:getSet> which serves as filter.

See documenation for <mbo:get> and <mbo:getSet>

Attributes

Name Type Description
var xs:string Parent variable
mbo:relationship

Child of <mbo:parent> and <mbo:getSet> which serves as filter.

See documenation for <mbo:get> and <mbo:getSet>

mbo:setAttributeValue

Sets a value to an attribute to identified by 'name' within the MBO speficied in 'mbo' variable.

In order to handle the condition where the passed attrubute 'name' contains a "." notation (for example, ASSET.CHILDREN when the current object is WorkOrder ),

this method first gets the correct object and then assigns the value to the attribute of the right object.

If the attrubute 'name' does not contain a ".", the 'mbo' variable object is assumed to be the one to set the value to the attribute specified.

Note: value of attibute will be changed to MBO which is in memory. In order to apply the changes to database, MBO must be saved.

Example:


<test name="testSetAttributeValueSimple">
		
	<var type="MboRemote" name="wo">null</var>
		
	<var type="String" name="description">
		"Testing mbo:setAttributeValue"
	</var>
		
	<mbo:get objectName="WORKORDER" var="wo">
		<mbo:where>
			WONUM = '1000'
		</mbo:where>
	</mbo:get>
		
	<mbo:setAttributeValue name="DESCRIPTION" mbo="wo" value="description" />
		
</test>

Attributes

Name Type Description
mbo xs:string Variable which holds the MBO reference.
name xs:string Attribute name
value xs:string Value to which attibute will be set
mbo:where

Child of <mbo:get> and <mbo:getSet> which serves as filter.

See documenation for <mbo:get> and <mbo:getSet>

 

mif:addListener

Adds a MIF queue listener.

Can only be used after the "listenProperties" tag which defines the listener properties.

This command attaches a listener to the queue specified in the "listenProperties" object.

Once the listener is attached, use the command "waitForMessage" to wait for the message that meets the filter criteria of the listenProperties.

After "waitForMessage" is triggered, i.e. the message has been detected,

use command "getMessageBody" to physically move the message into a string variable.

Example:

<!-- register listener -->
<mif:listenProperties name="woListener" queue="jms/maximo/int/queues/sqout" filter="1047" 	type="text" consumeMessage="false" />
		
<!-- add listener -->
<mif:addListener listenProperties="woListener" />
		
<!-- send a test message to the queue -->
<mif:sendMessage externalSystem="DATAEXPORT" publishChannel="MXWOInterface" filePath="c:tempxmlfilesWOImportXML.xml" />
		
<!-- get message body -->
<var type="String" name="woMessage">
	null
</var>
<mif:waitForMessage timeOut="25" />
<mif:getMessageBody var="woMessage" />
<stringToFile content="$woMessage" filePath="c:tempwoMessage.txt"/>

Attributes

Name Type Description
listenProperties string Name of the listenProperties element that holds the listening parameters. This element must be positioned before the addListener element.
mif:checkCronTaskInstance

Checks if Maximo Cron Task instance is valid.

Checks if cron task instance is active and if it is reloaded.

Also checks cron task instance parameters.

Check MESSAGEPROCESSOR, QUEUENAME and TARGETENABLED parameters.

If message processor class can not be initialized, queue that is placed in QUEUENAME property does not exists

or TARGETENABLED property does not have one of (n,y,0,1) values then exception is thrown.

Example:


<mif:checkCronTaskInstance cronName="JMSQSEQCONSUMER" instanceName="SEQQIN"/>

Attributes

Name Type Description
cronName string Name of Cron Task as defined in Maximo.
instanceName string Name of Cron Task instance as defined in Maximo.
mif:checkEjb

Checks if MIF can process messages through EJB for given External System and Enterprise Service.

Tries to initiate EJB and if initialization is unsuccessful exception is thrown.

Example:

<mif:checkEjb jndiName="ejb/maximo/remote/mosservice"/>

Attributes

Name Type Description
jndiName string JNDI name of EJB to be invoked.
mif:checkEndPointHandler

Checks if MIF End Point handler is valid.

Depending on endpoint handler corresponding verifications are processed.

For web service handler it first pings web services url and then checks if wsdl is deployed.

Also checks if SOAP action is same in wsdl and endpoint property and if service name is same in endpoint property and wsdl file.

For HTTP handler it pings URL.

For XML file or Flat file handler it checks if FILEDIR property is set on endpoint.

Checks if user has a permissions to write into folder that is specified in FILEDIR property of endpoint.

For JMS handler sends test message into the queue and does rollback after that. If there is any error during the sending of the message an exception is thrown.

For IFACETABLE handler checks if interface table exists.

If interface table is located on remote DB then checks connection to that DB and after that checks interface table existence.

Method check if flat file is supported on enterprise service/publish channel for the specified interface table.

For EJB handler checks EJB functionalities. Tries to initiate EJB and if initialization is unsuccessful exception is thrown.

Note: If handler is IFACETABLE than it it must have child element <mif:publishChannelName> in order to be tested.

Example:


<mif:checkEndPointHandler endPoint="MXIFACETABLE">
	<mif:wsdl>
		http://localhost:9080/meaweb/wsdl/DATAEXPORT_MXWOInterface.wsdl
	</mif:wsdl>
		
	<mif:publishChannelName>
		MXWOInterface
	</mif:publishChannelName>
</mif:checkEndPointHandler>

Attributes

Name Type Description
endPoint string Name of the end point as defined in Maximo.
mif:checkEndPointOnExtSys

Checks if MIF External System’s End Point is valid.

Depending on endpoint handler corresponding verifications are processed.

For web service handler it first pings web services url and then checks if wsdl is deployed.

Also checks if SOAP action is same in wsdl and endpoint property and if service name is same in endpoint property and wsdl file.

For HTTP handler it pings URL.

For XML file or Flat file handler it checks if FILEDIR property is set on endpoint.

Checks if user has a permissions to write into folder that is specified in FILEDIR property of endpoint.

For JMS handler sends test message into the queue and does rollback after that.

If there is any error during the sending of the message an exception is thrown.

For Interface table handler checks if interface table exists.

If interface table is located on remote DB then checks connection to that DB and after that checks interface table existence.

Method check if flat file is supported on enterprise service/publish channel where this interface table is placed.

For EJB handler checks EJB functionalities.

Tries to initiate EJB and if initialization is unsuccessful exception is thrown.

Example:


<mif:checkEndPointOnExtSys name="EXTSYS1"/>

Attributes

Name Type Description
name string External System Name as defined in Maximo
mif:checkFlatFile

Checks if MIF can process flat files for given External System and Enterprise Service.

Imports XML file in preview mode.

This means that file passes all business logic that is implemented for importing files, but at the end final step is not executed and file is not being imported into Maximo.

Example:


<mif:checkXmlFile enterpriseService="MXWOInterface" externalSystem="EXTSYS1" fileName="c:tempxmlfilesWOImportXML.xml"/>

Attributes

Name Type Description
enterpriseService string Name of Enterprise Service as defined in Maximo.
externalSystem string External System Name as defined in Maximo.
fileName string Name of the flat file to be sent.
mif:checkHttpChannel

Checks if MIF HTTP port is open for given External System and Enterprise Service.

Example:


<mif:checkHttpChannel enterpriseService="MXWOInterface" externalSystem="EXTSYS1" url="http://localhost:9080/meaweb/esqueue/EXTSYS1/MXWOInterface"/>

Attributes

Name Type Description
enterpriseService string Name of Enterprise Service as defined in Maximo.
externalSystem string External System Name as defined in Maximo.
url string URL of Maximo MEA web client including external system and enterprise service names.
mif:checkIfaceTable

Checks if MIF can process interface table messages for given enterprise service.

Example:


<mif:checkIfaceTable enterpriseService="MXWOInterface">
	<mif:interTransTbName>MX_WO_IFACE</mif:interTransTbName>
</mif:checkIfaceTable>

Attributes

Name Type Description
enterpriseService string Name of Enterprise Service as defined in Maximo.
mif:checkInContQueueOnExSys

Checks if MIF External System’s inbound continues queue is set and valid.

Tries to send message into inbound continuous queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkInContQueueOnExSys name="DATALOADING"/>

Attributes

Name Type Description
name string External System Name as defined in Maximo
mif:checkInSeqQueueOnExSys

Checks if MIF External System’s inbound sequential queue is set and valid.

Tries to send message into inbound sequential queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkInSeqQueueOnExSys name="EXTSYS1"/>

Attributes

Name Type Description
name string External System Name as defined in Maximo
mif:checkJmsQueue

Checks if MIF JMS queue is valid for given External System and Enterprise Service.

Depending on which inbound queue is used, it tries to send message into that queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkJmsQueue enterpriseService="MXWOInterface" externalSystem="EXTSYS1"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service.
externalSystem string Name of the external system.
mif:checkOutSeqQueueOnExSys

Checks if MIF External System’s outbound sequential queue is set and valid.

Tries to send message into outbound sequential queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkOutSeqQueueOnExSys name="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the external system as defined in Maximo.
mif:checkPublishChannelEndPoint

Checks if MIF Publish Channel‘s End Point is valid.

Depending on endpoint handler corresponding verifications are processed.

For web service handler it first pings web services url and then checks if wsdl is deployed.

Also checks if SOAP action is same in wsdl and endpoint property and if service name is same in endpoint property and wsdl file.

For HTTP handler it pings URL.

For XML file or Flat file handler it checks if FILEDIR property is set on endpoint. Check if user has a permissions to write into folder that is specified in FILEDIR property of endpoint.

For JMS handler Sends test message into the queue and does rollback after that. If there is any error during the sending of the message an exception is thrown.

For Interface table handler Check if interface table exists. If interface table is located on remote DB then check connection to that DB and after that check interface table existence. Method check if flat file is supported on enterprise service/publish channel where is this interface table placed.

For EJB handler Checks EJB functionalities. Tries to initiate EJB and if initialization is unsuccessful exception is thrown.

Example:


<mif:checkPublishChannelEndPoint name="MXWOInterface" externalSystemName="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the publish channel as defined in Maximo.
externalSystemName string Name of the external system as defined in Maximo.
mif:checkQueueMessageProcessing

Checks if MIF queue is processing message.

Tries to send message into specified queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkQueueMessageProcessing name="jms/maximo/int/queues/sqout"/>

Attributes

Name Type Description
name string JNDI name of the queue as defined in Maximo.
mif:checkWs

Checks if MIF Web Service is responding for given External System and Enterprise Service.

Checks web service inbound message processing.

First pings web services url and then checks if wsdl is deployed.

You can explicitly set read timeout and connection timeout using child elements

<mif:readTimeout> and <mif:connTimeout>

Example:


<mif:checkWs webServiceURL="http://localhost:9080/meaweb/services/DATAEXPORT_MXWOInterface"/>

Attributes

Name Type Description
webServiceURL string URL of the Maximo web service.
mif:checkXmlFile

Checks if MIF can process XML files for given External System and Enterprise Service.

Depending on which inbound queue is used, it tries to send message into that queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:

<mif:checkXmlFile enterpriseService="MXWOInterface" externalSystem="DATALOADING" fileName="c:\tempxmlfiles\WOImportXML.xml"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
fileName string Name of the XML file.
mif:configXMLPath Not supported - do not use.
mif:connTimeout

Sets a connection time out in making the initial connection, i.e. completing the TCP connection handshake.

Can only be used as an optional parameter within the checkWs tag.

Example:


<mif:checkWs webServiceURL="http://localhost:9080/meaweb/services/EXTSYS1_MXWOInterface">
	<mif:connTimeout>8</mif:connTimeout>
</mif:checkWs>
mif:cronTaskExist

Checks if Maximo Cron Task exists.

Example:


<mif:cronTaskExist cronName="JMSQSEQCONSUMER"/>

Attributes

Name Type Description
cronName string Name of the cron task as defined in Maximo.
mif:dataImport

Imports XML message for given External System and Enterprise Service.

To avoid database conflicts during imports, on critical fields in xml message file you can use $$#_ prefix

so if the field is autokeyed its value will be moved to next, or if it is not, custom MaxTAF value will be set on that field.

Example:


<mif:dataImport filePath="c:\tempxmlfiles\WOImportXML.xml" enterpriseService="MXWOInterface" externalSystem="EXTSYS1"/>

Attributes

Name Type Description
filePath string Full path to the import file.
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
mif:endPointExist

Checks if MIF End Point exists.

Example:


<mif:endPointExist name="MXXMLFILE"/>

Attributes

Name Type Description
name string Name of the end point as defined in Maximo.
mif:enterpriseServiceExist

Checks if MIF Enterprise Service exists.

Example:


<mif:enterpriseServiceExist name="MXWOInterface"/>

Attributes

Name Type Description
name string Name of the enterprise service as defined in Maximo.
mif:enterServEnabled

Checks if MIF External System’s Enterprise service is enabled.

Example:


<mif:enterServEnabled enterpriseService="MXWOInterface" externalSystem="EXTSYS1"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
mif:enterServExistOnExtSystem

Checks if MIF External System’s Enterprise Service exists on the specified external system.

Example:


<mif:enterServExistOnExtSystem enterpriseService="MXWOInterface" externalSystem="EXTSYS1"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
mif:externalSystemEnabled

Checks if the specified MIF external system is enabled.

Example:


<mif:externalSystemEnabled name="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the external system as defined in Maximo.
mif:externalSystemExist

Checks if the specified MIF external eystem exists.

Example:


<mif:externalSystemExist name="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the external system as defined in Maximo.
mif:fileSep

Sets the separator character used in flat files.

Can only be used as an optional parameter within following tags:

checkFlatFile

messageToMxFlatFile

mif:getMessageBody

Reads the message body after it has been received into the monitored queue.

Example:


<!-- add listener -->
<mif:addListener listenProperties="woListener" />
		
<!-- send a test message to the queue -->
<mif:sendMessage externalSystem="DATAEXPORT" publishChannel="MXWOInterface" filePath="c:tempxmlfilesWOImportXML.xml" />
		
<!-- get message body -->
<var type="String" name="woMessage">
	null
</var>
<mif:waitForMessage timeOut="25" />
<mif:getMessageBody var="woMessage" />
<stringToFile content="$woMessage" filePath="c:tempwoMessage.txt"/>

Attributes

Name Type Description
var string Variable name for storing message content
mif:httpConnTimeout

Sets the timeout period in milliseconds before an HTTP connection is established.

Can only be used as an optional parameter within the messageToMxWebService tag.

If omitted, a default value of 60000 milliseconds will be used.
mif:httpPassword

Sets the password for the HTTP connection.

Can only be used as an optional parameter within the messageToMxWebService tag.

mif:httpProtocolVersion

Specifies the version of the HTTP protocol for Web service invocations.

The valid values are HTTP/1.0 and HTTP/1.1.

If you do not provide a

value, the system uses the default value, HTTP/1.1.
mif:httpReadTimeout

Specifies the read timeout value in milliseconds.

Can only be used as an optional parameter within the messageToMxWebService tag.

If ommitted, the default value of 60000 milliseconds will be used.
mif:httpUserName Sets the HTTP user name if the HTTP basic authentication is enabled.
mif:interTransTbName

Sets the interface transaction table name.

Can only be used as an optional parameter within the messageToMxIfaceTable tag.
mif:listenProperties Specifies parameters for a queue listener.

Attributes

Name Type Description
name string Listener name
queue string Queue name
filter string Filter
type string
consumeMessage string Boolean flag which denotes if the message should be consumed or not. Valid values are "true" and "false".
mif:mep Specifies the message exchange pattern.
mif:messageToMxEjb

Sends message to Maximo using EJB for given Enterprise Service.

Messages can be sent over enterprise service or the object structure.

For the enterprise service, you must define <mif:methodName> which can have two values: processExternalDataAsync or processExternalDataSync.

Example:


<mif:messageToMxEjb enterpriseService="MXWOInterface" filePath="c:tempxmlfilesWOImportEJB.xml" jndiName="ejb/maximo/remote/enterpriseservice"  sender="EXTSYS1">
        <mif:methodName>processExternalDataAsync</mif:methodName>
         <mif:providerURL></mif:providerURL>
         <mif:userid></mif:userid>
         <mif:password></mif:password>
</mif:messageToMxEjb>

For the object structure you must define <mif:mosName> which is the object structure name as defined in Maximo.

Example:

<mif:messageToMxEjb enterpriseService="MXWOInterface" filePath="c:tempxmlfilesWOImportEJB.xml" jndiName="ejb/maximo/remote/mosservice"  sender="EXTSYS1">
         <mif:mosName>MXWO</mif:mosName>
         <mif:providerURL></mif:providerURL>
         <mif:userid></mif:userid>
         <mif:password></mif:password>
</mif:messageToMxEjb>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
sender string Name of the external system as defined in Maximo.
filePath string Full path to the import file.
jndiName string JNDI name as defined in the application server and Maximo.
mif:messageToMxFlatFile

Sends flat file message to Maximo using specified external system and enterprise service.

Note: If you don't use default file separator and text qualifier, you can use optional child elements <mif:fileSep> and <mif:textQualifier>

Example:


<mif:messageToMxFlatFile filePath="c:tempxmlfilesWOImportFlat.dat" externalSystem="EXTSYS1" enterpriseService="MXWOInterface"/>

Attributes

Name Type Description
filePath string Full path to the file to be imported.
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
mif:messageToMxHttp

Sends message to Maximo using HTTP.

Note: You can set username and password using child elements:

<mif:userid> and <mif:password></mif:password>

Example:


<mif:messageToMxHttp enterpriseService="MXWOInterface" filePath="c:tempxmlfilesWOImportHTTP.xml" url="http://localhost:9080/meaweb/esqueue/EXTSYS1/MXWOInterface"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
filePath string Full path to the file to be imported.
url string URL to which the HTTP request is sent.
mif:messageToMxIfaceTable

Imports message using interface table for given External System and Enterprise Service.

Note: Optional properties (url, intertrans table, username, password, driver) can be set using child elements:

<mif:url>, <mif:interTransTbName>, <mif:userName>, <mif:password> and <mif:driver>

Example:


<mif:messageToMxIfaceTable filePath="c:tempxmlfilesWOImportXML.xml" enterpriseService="MXWOInterface" externalSystem="EXTSYS1" isRemote="true"/>

Attributes

Name Type Description
externalSystem string Name of the external system as defined in Maximo.
enterpriseService string Name of the enterprise service as defined in Maximo.
filePath string Full path to the message file.
isRemote string Boolean which determines if the interface table is on a remote system.
mif:messageToMxJmsQueue

Imports message directly trough JMS queue for given External System and Enterprise Service.

Example:


<mif:messageToMxJmsQueue filePath="c:\\temp\\xmlfiles\\WOImportXML.xml" externalSystem="EXTSYS1" enterpriseService="MXWOInterface"/>

Attributes

Name Type Description
enterpriseService string Name of the enterprise service as defined in Maximo.
externalSystem string Name of the external system as defined in Maximo.
filePath string Full path to the message file.
mif:messageToMxWebService

Imports message through web service.

Example:


<mif:messageToMxWebService serviceName="EXTSYS1_MXWOInterface" filePath="c:tempxmlfilesWOImportXML.xml" webServiceURL="http://localhost:9080/meaweb/services/EXTSYS1_MXWOInterface" soapAction="processDocument" >
        <mif:utUser>MAXADMIN</mif:utUser>
        <mif:httpReadTimeout>20000</mif:httpReadTimeout>
        <mif:httpConnTimeout>20000</mif:httpConnTimeout> 
</mif:messageToMxWebService>

Attributes

Name Type Description
filePath string Full path to file
webServiceURL string Full path to the message file.
serviceName string Name of the service name as defined in Maximo.
soapAction string Soap action name
mif:messageToMxXmlFile

Imports XML message.

Copies file to MIF directory which is set in cron instance's SOURCEDIRECTORY parameter.

Example:


<mif:messageToMxXmlFile filePath="c:\tempxmlfiles\WOImportXML.xml" cronInstanceName="WORKORDER"/>

Attributes

Name Type Description
filePath string Full path to the message file.
cronInstanceName string Name of the cron instance
mif:methodName

Sets the connection method.

Can only be used as a property tag within the messageToMxEjb tag.
mif:mosName

Sets the interface name.

Can only be used as a child element within the messageToMxEjb tag.
mif:publishChannelEnabled

Checks if MIF External System’s Publish Channel is enabled.

Example:


<mif:publishChannelEnabled name="MXWOInterface" externalSystemName="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the publish channel as defined in Maximo.
externalSystemName string Name of the external system as defined in Maximo.
mif:publishChannelEventListenerEnabled

Checks if MIF Publish Channel’s event listener is enabled.

Example:


<mif:publishChannelEventListenerEnabled name="MXWOInterface"/>

Attributes

Name Type Description
name string Name of the publish channel
mif:publishChannelExist

Checks if MIF Publish Channel exists.

Example:

<mif:publishChannelExist name="MXWOInterface"/>

Attributes

Name Type Description
name string Name of the publish channel
mif:publishChannelExistOnExternalSystem

Checks if MIF External System’s Publish Channel exists.

Example:


<mif:publishChannelExistOnExternalSystem name="MXWOInterface" externalSystemName="EXTSYS1"/>

Attributes

Name Type Description
name string Name of the publish channel as defined in Maximo.
externalSystemName string Name of the external system as defined in Maximo.
mif:password

Sets the password.

Can only be used as an optional parameter within the following tags:

checkEjb

messageToMxEjb

messageToMxHttp

messageToMxIfaceTable
mif:providerUrl

Sets the url of the application server where the enterprise bean is located.

Can only be used as an optional parameter within the messageToMxEjb tag.
mif:queueExist

Checks if MIF queue exists.

Example:


<mif:queueExist name="jms/maximo/int/queues/sqin"/>

Attributes

Name Type Description
name string Name of the queue.
mif:queueName

Checks if MIF queue is processing message.

Tries to send message into specified queue.

If there is any error exception is thrown.

Message is rolled back if there is no exception during the sending.

Example:


<mif:checkQueueMessageProcessing name="jms/maximo/int/queues/sqout"/>

Attributes

Name Type Description
name string Name of the queue.
mif:sendMessage Checks if MIF can send message for given External System and Publish Channel.

Attributes

Name Type Description
externalSystem string Name of the external system as defined in Maximo.
publishChannel string Name of the publish channel as defined in Maximo.
filePath string Full path to the message file.
mif:soapVersion Sets the SOAP version.

mif:textQualifier

Sets the start and end character which denotes a text section.

Can only be used as an optional parameter within the checkFlatFile tag.
mif:url

Sets the URL value.

Can only be used as an optional parameter within the messageToMxIfaceTable tag.
mif:userid

Sets the user ID.

Can only be used as an optional parameter within following tags:

messageToMxHttp

messageToMxEjb

mif:userName

Sets the user name.

Can only be used as an optional parameter within the messageToMxIfaceTable tag.

mif:utPassword Not supported - do not use.
mif:utUser Not supported - do not use.
mif:waitForMessage Sets the time to wait for a message to appear in the queue.

Attributes

Name Type Description
timeOut int Time to wait for the message in seconds.
mif:wsAddrVersion

Sets the web service addressing version.

Can only be used as an optional parameter within the messageToMxWebService tag.

mif:wsdl

Sets the WSDL url.

Can only be used as an optional child tag within the checkEndPointHandler tag.

 

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

Example:


<ui:assertElementPresent>
	<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertElementPresent>
			
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

Example:


<ui:assertText text="Go To">
<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:assertText>

		

Attributes

Name Type Description
text xs:string Text that will be checked.
ui:assertTextPresent

Checks if certain text appears somewhere on the rendered page.

Example:


<ui:assertTextPresent text="Work Order Tracking"/>

Attributes

Name Type Description
text xs:string String to be matched with the text on the rendered page.
ui:assertTitle

Element that checks if certain text is equal to title of the current page.

Example:


<ui:assertTitle title="Work Order Tracking" />

Attributes

Name Type Description
title xs:string String which is expected to be the same as the title of the page.
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

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>



Attributes

Name Type Description
value xs:string Value string which is expected to be the same as the value of the input element returned by the selector.
ui:changeApp

Opens the specified application.

Name must be a valid Maximo application name.

Example:


<ui:changeApp name="startcntr"></ui:changeApp>
			

Attributes

Name Type Description
name xs:string String which holds the application name.
ui:clear

Clears a text field.

Example:


<ui:clear>
	<ui:xpath>//*[@staticId='changestatus_grid1_1_1_grid4_3a-textbox_textbox']</ui:xpath>
</ui:clear>
ui:click

Performs a click on an element.

Used mostly to click link elements on the page.

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:clickEvent

Directly executes Maximo java script function sendEvent. Use this as an alternative to ui:click when ui:click doesn't work.

Example:


	  <!-- sendEvent click  -->
	  <ui:clickEvent>
	  	<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
	  </ui:clickEvent>
			
ui:clickSimple

Clicks on element by performing native click event. Use this as an alternative to ui:click when ui:click doesn't work.

Example:


	  <!-- simple click  -->
	  <ui:clickSimple>
	  	<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
	  </ui:clickSimple>
			
ui:close

Closes the connection to the web driver.

Automatically added to a UI test within the <afterTestCase> tag.

Example:


<ui:close/>
ui:createDriver

Creates a connection to the web driver.

When a UI test is created this is automatically inserted into the <beforeTestCase> tag.
ui:doubleClick

Double clicks on the element.

Example:


	  <!-- double click  -->
	  <ui:doubleClick>
	  	<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
	  </ui:doubleClick>
			
ui:executeScript

Executes JavaScript on the test page.

Can interact with existing JavaScript created by the test logic.

Example:


<ui:executeScript jsCode="warnExit=false" />
			

Attributes

Name Type Description
jsCode xs:string This is a JavaScript code expression. Must follow standard JavaScript coding format.
ui:getAttribute

Gets attribute value of web element.

Must match only one child element represented by the selector.

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" />





Attributes

Name Type Description
var xs:string String which will store the returned value.
name xs:string Name of the attribute.
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.

Example:


<var name="isElemPresent" type="Boolean">null</var>
<ui:getElementPresent var="isElemPresent">
	<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:getElementPresent>
			

Attributes

Name Type Description
var xs:string Boolean variable to store results.
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.

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" />


Attributes

Name Type Description
var xs:string Variable which holds the returned value.
ui:getTextPresent

Checks if certain text appears somewhere on the rendered page.

Returned value is stored into the referenced variable.

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" />

Attributes

Name Type Description
text xs:string Text value which is to be searched for.
var xs:string String which will store the returned value.
ui:getTitle

Stores the title of the current page into the specified variable.

Example:


<var type="String" name="pageTitle">""</var>
<ui:getTitle var="pageTitle" />

Attributes

Name Type Description
var xs:string String which holds the returned value.
ui:getValue

Gets value of text input element.

Must match only one element returned by the selector.

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" />

Attributes

Name Type Description
var xs:string String which will store the returned value.
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.

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:login

Log in the current user.

Example:


<ui:login >
	<ui:userName>maxadmin</ui:userName>
	<ui:password>maxadmin</ui:password>
</ui:logint >
			
ui:logout

Log out the current user.

Example:


<ui:logout />
			
ui:maximizeWindow

Maximizes the browser window.

Example:


<ui:maximizeWindow />
ui:openApp

Opens the specified application.

Name must be a valid Maximo application name.

Example:


<ui:openApp name="startcntr"></ui:openApp>
			

Attributes

Name Type Description
name xs:string String which holds the application name.
ui:screenshot

Captures a screenshot of the page and stores it into the specified file.

File name must conform to file naming convention of the OS.

Example:


<ui:screenshot file="screenshot.jpg" />

Attributes

Name Type Description
file xs:string String which stores the file name.
ui:sendKeys

Simulates typing into a text input web element.

Must match only one child element that is returned by the selector.

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" />

Attributes

Name Type Description
text xs:string String which will be sent to the textbox element.
ui:sendParam

Sends the test parameter value to specified field.

Example:


	  <!-- sendParam  -->
	  <ui:sendParam name="paramName">
	  	<ui:xpath>//*[@staticId='plans_children_table-table_expand_contract']"</ui:xpath>
	  </ui:sendParam>
			

Attributes

Name Type Description
name xs:string String which holds the test parameter name.
ui:setInnerHTML

Sets the element's inner html.

Replaces any html found in the element located.

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: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:switchToFrame

Switches focus to the specified frame. Mostly used for interaction with elements in iFrames.

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:switchToMainWindow

Switches control to the main window. Main window is the window in which the test started running.

Example:


<ui:switchToMainWindow closeCurrent="true" />
			

Attributes

Name Type Description
closeCurrent xs:boolean Value that determines if the current window is closed before switching to main window.
ui:switchToWindow

Switches control to different window with specified title. If closeCurrent attribute is true, current window will be closed before switching.

Example:


<ui:switchToWindow title="BIRT Report Viewer" closeCurrent="false" />
			

Attributes

Name Type Description
title xs:string Title of the window. Must be same title as the head tag title of the page.
closeCurrent xs:boolean Value that determines if the current window is closed before switching.
ui:verifyElementPresent

Verifies if specified element is somewhere on the page.

Must match only one element returned by the selector.

Example:


<ui:verifyElementPresent>
	<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:verifyElementPresent>
			
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.

Example:


<ui:verifyText text="o To">
	<ui:xpath>//span[@id='mx47']/span/span[3]</ui:xpath>
</ui:verifyText>

Attributes

Name Type Description
text xs:string String which is the value that is being verified.
ui:verifyTextPresent

Verifies if certain text appears somewhere on the rendered page.

Example:

 

<ui:verifyTextPresent text="o To" />

Attributes

Name Type Description
text xs:string String which holds the text to be searched for on the rendered page.
ui:verifyTitle

Verifies that the title of the page matches the specified title text.

Example:


<ui:verifyTitle title="Work Order" />

Attributes

Name Type Description
title xs:string Text that will be checked.
ui:verifyValue

Verifies if specified text is equal to value of input web element.

Must match only one element returned by the selector.

Example:

	<ui:verifyValue value="1001">
		<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_textbox_2']</ui:xpath>
	</ui:verifyValue>

Attributes

Name Type Description
value xs:string Value that will be checked.
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).

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>

Attributes

Name Type Description
time xs:positiveInteger Time interval in seconds.
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.

Example:


<ui:waitForElementPresent time="30">
	<ui:xpath>//*[@staticId='headerA_5-multiparttextbox_label']</ui:xpath>
</ui:waitForElementPresent>
			

Attributes

Name Type Description
time xs:positiveInteger Time interval in seconds.
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.

Example:


<ui:waitForText text="Originating Record:" time="30">
	<ui:xpath>//*[@staticId='main_grid9_1-textbox_label']</ui:xpath>
</ui:waitForText>

Attributes

Name Type Description
text xs:string Text to be waited for
time xs:positiveInteger Time interval in seconds.
ui:waitForTextPresent

Verifies if certain text appears somewhere on the rendered page in the specified number of seconds.

Example:


<ui:waitForTextPresent text="Originating Record:" time="30" />

Attributes

Name Type Description
text xs:string String to be matched with the text on the rendered page.
time xs:positiveInteger Time interval in seconds.
ui:waitForTitle

Verifies if specified text will be equal to the rendered page title in the specified number of seconds.

Example:


<ui:waitForTitle title="Work Order" time="30" />

Attributes

Name Type Description
title xs:string String which is to be matched to the page title.
time xs:positiveInteger Time interval in seconds.
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.

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>
			
ui:waitForValue

Verifies if the specified text will be equal to the value of an input element in the specified number of seconds.

Example:


<ui:waitForValue value="WORKORDER" time="10">
	<ui:xpath>//*[@staticId='main_grid3_2-textbox_textbox']</ui:xpath>
</ui:waitForValue>

Attributes

Name Type Description
value xs:string Value to be waited for.
time xs:positiveInteger Time interval in seconds.

 

db:closeConnection

Closes opened database connection defined by db:connection.

Example:

	<db:closeConnection connection = "myConnection"/>

Attributes

Name Type Description
connection string Connection object to close
db:connection

Creates a connection to database.

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>
		
	

Attributes

Name Type Description
var string Variable which will hold the connection.
db:forEachResult

Loops through given result set and fetches records. For each fetched record the nested child elements will be processed.

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"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
db:getBlobFromResult

Child of <db:forEachResult>

See documenation for <db:forEachResult>

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched blob value.
db:getBlobFromResultSet

Gets BLOB value from record identified by given row number from given result set.

Example:

	<var name="resultBlob" type="Blob">
			null
	</var>
	<db:getBlobFromResultSet resultSet="rs" field="RESOURCES" row="1" var="resultBlob"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched Blob value.
row int row number, starts with 1
db:getBooleanFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched boolean value.
db:getBooleanFromResultSet

Gets boolean value from record identified by given row number from given result set.

Example:

	<var name="resultBoolean" type="boolean">
			false
	</var>
	<db:getBooleanFromResultSet resultSet="rs" field="WOACCEPTSCHARGES" row="1" var="resultBoolean"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched boolean value.
row int row number, starts with 1
db:getByteFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched byte value.
db:getByteFromResultSet

Gets byte value from record identified by given row number from given result set.

Example:

	<var name="resultByte" type="byte">
			0
	</var>
	<db:getByteFromResultSet resultSet="rs" field="ASSETLOCPRIORITY" row="1" var="resultByte"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched byte value.
row int row number, starts with 1
db:getBytesFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched bytes value.
db:getBytesFromResultSet

Gets bytes value from record identified by given row number from given result set.

Example:

	<var name="resultBytes" type="byte[]">
			null
	</var>
	<db:getBytesFromResultSet resultSet="rs" field="RESOURCES" row="1" var="resultBytes"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched bytes value.
row int row number, starts with 1
db:getClobFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched clob value.
db:getClobFromResultSet

Gets CLOB value from record identified by given row number from given result set.

Example:

	<var name="resultClob" type="Clob">
			null
	</var>
	<db:getClobFromResultSet resultSet="rs" field="LDTEXT" row="1" var="resultClob"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched Clob value.
row int row number, starts with 1
db:getDateFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched date value.
db:getDateFromResultSet

Gets Date value from record identified by given row number from given result set.

Example:

	<var name="resultDate" type="Date">
			null
	</var>
	<db:getDateFromResultSet resultSet="rs" field="PMDUEDATE" row="1" var="resultDate"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched Date value.
row int row number, starts with 1
db:getFloatFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched float value.
db:getFloatFromResultSet

Gets float value from record identified by given row number from given result set.

Example:

	<var name="resultFloat" type="float">
			0
	</var>
	<db:getFloatFromResultSet resultSet="rs" field="WOPRIORITY" row="3" var="resultFloat"/>
	

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched float value.
row int row number, starts with 1
db:getIntFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched integer value.
db:getIntFromResultSet

Gets integer value from record identified by given row number from given result set.

Example:

	<var name="resultInt" type="int">
			0
	</var>		
	<db:getIntFromResultSet resultSet="rs" field="ESTMATCOST" row="1" var="resultInt"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched integer value.
row int row number, starts with 1
db:getLongFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched long value.
db:getLongFromResultSet

Gets long value from record identified by given row number from given result set.

Example:

	<var name="resultLong" type="long">
			0
	</var>		
	<db:getLongFromResultSet resultSet="rs" field="WORKORDERID" row="1" var="resultLong"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched long value.
row int row number, starts with 1
db:getStringFromResult

Child of <db:forEachResult>

See documenation for <db:forEachResult>

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched String value.
db:getStringFromResultSet

Gets string value from record identified by given row number from given result set.

Example:

	<var name="resultString" type="String">
				null
	</var>
	<db:getStringFromResultSet resultSet="rs" field="WONUM" row="1" var="resultString"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched String value.
row int row number, starts with 1
db:getTimestampFromResult

Child of &lt;db:forEachResult&gt;

See documenation for &lt;db:forEachResult&gt;

Attributes

Name Type Description
fieldName string Name of the field from which value will be fetched.
var string Variable which will hold fetched timestamp value.
db:getTimestampFromResultSet

Gets Date value from record identified by given row number from given result set.

Example:

	<var name="resultTimestamp" type="Timestamp">
			null
	</var>
	<db:getTimestampFromResultSet resultSet="rs" field="STATUSDATE" row="1" var="resultTimestamp"/>

Attributes

Name Type Description
resultSet string Name of the result set, must be variable that was obtain with db:sql element.
field string Name of the field from which value will be fetched.
var string Variable which will hold fetched Timestamp value.
row int row number, starts with 1
db:sql

SQL to execute on specified DB connection. Returned result set is stored into variable.

Example:

		<var type="ResultSet" name="rs">null</var>
		<db:sql connection="dataLoaderConn" var="rs">
			select * from staging_asset
		</db:sql>
db:password

Database password.

Example:

	<db:password>maximo</db:password>
db:url

Database URL, holds database connect string.

Example:

	<db:url>jdbc:oracle:thin:@//localhost:1521/max1</db:url>
db:userName

Database username.

Example:

	 <db:userName>maximo</db:userName>

 

net:checkURLResponseCode

Test response code for given URL.

Example:

	<net:checkURLResponseCode url="http://www.google.com" responseCode="200"/>

Attributes

Name Type Description
url string URL for which response code will be tested.
responseCode string Expected response code.
net:getURLResponseCode

Returns response code from given URL.

Example:

	<var name="response" type="int">
			0
	</var>
	<net:getURLResponseCode url="http://www.google.com" var="response"/>

Attributes

Name Type Description
url string URL for which response code will be fetched.
var string Variable which will hold returned response code (number).
net:ping

Test the reachability of a host on an Internet Protocol (IP) network.

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>

Attributes

Name Type Description
host string IP address or Computer name whose reachability will be tested.
net:port

Child of <net:ping>

See documenation for <net:ping>

 

time:addTime

Adds or subtracts the specified amount of given unit of time to the given Date variable. Variable can be negative.

Example:

	<time:addTime var="currentDate" amount="15" unit="MINUTE" />
	

Attributes

Name Type Description
var string Variable which will hold Date value to be altered with.
amount string Variable which will hold amount of time unit to be added or subtracted. Variable can be negative.
unit string Variable which will hold unit of time. Allowed units: MILLISECOND, SECOND, MINUTE, HOUR, DAY, MONTH, YEAR
time:getCurrentMinute

Returns the number of minutes past the hour.

Example:

	<var type="int" name="minute">
			0
	</var>
	<time:getCurrentMinute var="minute"/>

Attributes

Name Type Description
var string Variable which will hold returned minutes.
time:getCurrentSecond

Returns the number of seconds past the minute.

Example:

	<var type="int" name="second">
			0
	</var>
	<time:getCurrentSecond var="second"/>

Attributes

Name Type Description
var string Variable which will hold returned seconds (number).
time:getDayOfMonth

Returns the day of the month. Returned value is number.

example:

<var type="int" name="dayOfMonth">

0

</var>

<time:getDayOfMonth var="dayOfMonth"/>

Attributes

Name Type Description
var string Variable which will hold returned day of the month(number).
time:getDayOfWeek

Returns the day of the week. Returned value is number in interval 1-7 (starting with sunday).

example:

<var type="int" name="dayOfWeek">

0

</var>

<time:getDayOfWeek var="dayOfWeek"/>

Attributes

Name Type Description
var string Variable which will hold returned day of the week (number).
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.

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>

Attributes

Name Type Description
var string Variable which will hold returned date-time string.
format string Date and time pattern.
time:getHourOfDay

Gets the current hour. Returned value is a number.

Example:

	<var type="int" name="hourOfDay">
			0
	</var>
	<time:getHourOfDay var="hourOfDay"/>

Attributes

Name Type Description
var string Variable which will hold returned hour (number).
time:getMonth

Returns a number representing the current month. Returned number id in interval 0-11 (starting with January).

example:

<var type="int" name="month">

0

</var>

<time:getMonth var="month"/>

Attributes

Name Type Description
var string Variable which will hold returned month (number).
time:getSeconds

Transforms milliseconds to seconds.

Example:

	<var name="mills" type="long">
				2017
	</var>		
	<var type="float" name="sec">
				0
	</var>
	<time:getSeconds milliseconds="mills" var="sec"/>

Attributes

Name Type Description
milliseconds string Variable which holds milliseconds.
var string Variable which will hold returned seconds.
time:getTime

Returns a Date object representing current time value.

Example:

	<var type="Date" name="time">
				null
	</var>
	<time:getTime var="time"/>

Attributes

Name Type Description
var string Variable which will hold returned Date value.
time:getYear

Returns the current year.

Example:

	<var type="int" name="year">
					0
	</var>
	<time:getYear var="year"/>

Attributes

Name Type Description
var string Variable which will hold returned year.
time:stopwatchResume

Resume the stopwatch after a suspend. The watch will not include time between the suspend and resume calls in the total time.

Example:

	<time:stopwatchResume name="stopwatch1"/>

Attributes

Name Type Description
name string Name of the stopwatch (variable which holds the stopwatch instance).
time:stopwatchSplit

Returns time passed since starting stopwatch. Returned time is in milliseconds.

Example:

		<var name="split1" type="long">
					0
		</var>		
		<time:stopwatchSplit name="stopwatch1" var="split1"/>

Attributes

Name Type Description
name string Name of the stopwatch (variable which holds the stopwatch instance).
var string Variable which will hold returned time. Returned time is in milliseconds and variable which will hold it must have type long.
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)

Example:

	<var name="stopwatch1" type="StopWatch">
				null
	</var>
	<time:stopwatchStart name="stopwatch1"/>

Attributes

Name Type Description
name string Name of the variable which will hold the stopwatch instance.
time:stopwatchStop

Stop the stopwatch (ends the timing session) and returns time in millisecond.

Example:

	<var name="stop1" type="long">
				0
	</var>
	<time:stopwatchStop name="stopwatch1" var="stop1"/>

Attributes

Name Type Description
name string Name of the stopwatch (variable which holds the stopwatch instance).
var string Variable which will hold returned time. Returned time is in milliseconds and variable which will hold it must have type long.
time:stopwatchSuspend

Suspend the stopwatch for later resumption.

Example:

		<time:stopwatchSuspend name="stopwatch1"/>

Attributes

Name Type Description
name string Name of the stopwatch (variable which holds the stopwatch instance).
time:wait

Stops the test thread for a specified number of seconds.

Example:

	<time:wait period="5"/>

Attributes

Name Type Description
period xs:positiveInteger Time frame during which the test thread is stoped(in seconds).
time:dateVar

Child of <time:getFormatedTime>

See documenation for <time:getFormatedTime>

 

wf:completeAssignment

Completes the assignment for the user, workflow, object combination. States whether the assignment is accepted or declined.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="wo"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
	  <wf:hasAssignment user="smith" object="wo" process="WOAPPROVE" /> 
	  <wf:completeAssignment user="smith" object="wo" process="WOAPPROVE" memo="Completed by WF1 test" accepted="true" />

</test>

Attributes

Name Type Description
user tns:nonEmptyString Maximo User. Must be in lowercase.
object tns:nonEmptyString Maximo object
process tns:nonEmptyString Workflow name
memo tns:nonEmptyString Memo
accepted tns:nonEmptyString States whether the assignment is accepted or declined. Must have values "true" or "false".
wf:getUser

Retrieves Maximo user object for the user specified in the attribute 'userName' into variable 'var'.

Example:


<test name="testUser">

	  <!-- make user object based on input parameter -->
	  <var name="user" type="psdi.security.UserInfo">null</var>
	  <var name="userName" type="String">null</var>
	  <getTestParam name="user" variable="$userName"/>
	  <wf:getUser userName="$userName" var="$user"/>
	  
</test>

Attributes

Name Type Description
userName tns:nonEmptyString Valid Maximo user name. Must be in lowercase.
var tns:nonEmptyString Variable for the user object. Must be type "psdi.security.UserInfo".
wf:hasAssignment

Confirms that the user has an assignment for the given object and workflow.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="wo"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
	  <wf:hasAssignment user="smith" object="wo" process="WOAPPROVE" /> 
</test>

Attributes

Name Type Description
user tns:nonEmptyString Name of the Maximo user. Must be in lowercase.
object tns:nonEmptyString Maximo Object
process tns:nonEmptyString Workflow name
wf:hasAssignmentOnNode

Confirms that the user has an assignment for the given object, node name and workflow.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="wo"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
	  <wf:hasAssignmentNode user="smith" object="wo" process="WOAPPROVE" nodeTitle="FIN APPR1" /> 
</test>

Attributes

Name Type Description
user tns:nonEmptyString Name of the Maximo user. Must be in lowercase.
object tns:nonEmptyString Maximo Object
process tns:nonEmptyString Workflow name
nodeTitle tns:nonEmptyString Node title
wf:hasAssignmentOnNodeId

Confirms that the user has an assignment for the given object, node name and workflow.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="wo"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
	  <wf:hasAssignmentOnNodeId user="smith" object="wo" process="WOAPPROVE" nodeId="FIN APPR1" /> 
</test>

Attributes

Name Type Description
user tns:nonEmptyString Name of the Maximo user. Must be in lowercase.
object tns:nonEmptyString Maximo Object
process tns:nonEmptyString Workflow name
nodeId tns:nonEmptyString Node ID
wf:initiateWorkflow

Initiates given workflow process for the given MBO.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="woOriginal"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
      <mbo:duplicate var="wo" original="woOriginal" />
	  <wf:initiateWorkflow name="WOAPPROVE" object="wo"/>
</test>

Attributes

Name Type Description
name tns:nonEmptyString Name of the workflow to initiate
object tns:nonEmptyString MBO where the workflow will be initiated
wf:stopWorkflow

Stops the workflow on the given object.

Example:


<test name="testInitiateWorkflow">
	  <mbo:get objectName="WORKORDER" var="wo"><mbo:where>WONUM = 'GT500'</mbo:where></mbo:get>
	  <wf:hasAssignment user="smith" object="wo" process="WOAPPROVE" /> 
	  <wf:completeAssignment user="smith" object="wo" process="WOAPPROVE" memo="Completed by WF1 test" accepted="true" />
	  <wf:stopWorkflow object="wo" memo="Stopped Workflow by Test Script" process="WOAPPROVE"/>
</test>

Attributes

Name Type Description
object tns:nonEmptyString Maximo Object.
process tns:nonEmptyString Workflow name
memo tns:nonEmptyString Memo

You can extend MXML functionality by building your own xml elements.

Developing new MXML elements requires the following skills:
  • Java
  • Maximo customisation
  • XML
  • XSD

As mentioned in other parts of this manual, MaxTAF MXML elements are abstractions of Java code. In simple terms, when MXML script is compiled, for every element in the script, MaxTAF takes the associated Java code template, replaces the attributes' values in the template and appends the result to the Java code.

For example, the following MXML element

<getTestParam name="compMasterName" variable="$compMasterName" />
compiles into the following Java code:
{
	if(testProperties==null){
		testProperties = new TestProperties(params);
	}
	if(testProperties.getProperties().getProperty("compMasterName")==null){
		testReport.addTestStepReport("Getting test property","Getting test property with name: "+"compMasterName","Test property not found!","FAILED");
		status = "FAILED";
		throw new NoTestPropertyException("There is no test property with name: "+"compMasterName");
	}
	compMasterName = testProperties.getProperties().getProperty("compMasterName");
	}
To extend MXML with your own elements, you need to perform the following 2 tasks:
  1. Create/program Java template
  2. Set the XSD definition for the element

Both the Java template file and the XSD definition file are kept in the MaxTAF directory structure. This is very convenient when developing new elements as you can work in real-time without having to deploy or compile.

Your Java template file, also known as the Commands file, must be located in <maxtaf_root>/mxml/commands directory. You can name the file anyway you like but its extension must be XML, e.g myco.xml.

Your XSD file must be located in <maxtaf_root>/mxml/xsd directory. You can also name this file anyway you like but with extension .xsd, e.g. myco.xsd.

Additionally, when you are first starting with building extensions, you also must register your XSD extension file in the file ext.xsd that is located in the <maxtaf_root>/mxml/xsd. To register the file insert the following tag with the xs:schema tag:

<xs:include schemaLocation="xsd_file_name"/>

Where:

xsd_file_name is the file name of your XSD file, e.g. myco.xsd.

The Java code template for your extension element is held in the Commands file (see previous). This file is an XML file. Your new element is defined with the following XML structure:

<ext:element_name xmlns:ext="http://www.maxtaf.com/ext">
		<attributes>
			<attribute name="attribute_name" type="attribute_type"/>
		</attributes>
		
		<begin>
			...opening_code...		
		</begin>

		...main_code...

		<ext:sub_element name...></ext:sub_element>

		<end>
			...closing_code...
		</end>
		<imports>				 
			<import>
				java_import
			</import>
		</imports>
		<exceptions>
			<exception>java_exception</exception>
		</exceptions>

	<ext:element_name>

Where:

element_name is the name of your element. You can use any name as long as it does not clash with an existing element. It is strongly recommended that you prefix all of your elements with a unique prefix e.g. myco_ and thus avoid possible collisions with extended elements produced by other developers/teams/vendors.

attribute_name is the name of an attribute of your element. You can use any name for your attribute.

attribute_type is the type of your attribute. It has to be a valid XSD type.

opening_code is the top part of your Java code

main_code is all of your Java code in cases when you don't need to split your code. Therefore you either use begin and end tags and keep your code there, or you place all of your code in the main_code area.

sub_element is one or many MXML ext:element structures that are nested inside the main code. They follow the exact same rules as for the main element. Through your element's XSD definition in the XSD file, you can control whether you want to allow one or many repeats of these sub-elements and whether they are optional or mandatory. The code of the sub-elements is always nested between the begin and end segments.

closing_code is the very bottom segment of your Java code.

java_import is a Java import declaration needed for the element's Java code, e.g. psdi.app.workorder.WORemote.

java_exception is a Java exception declaration needed for the element's Java code, e.g. MXException.

MXML compiler works by first making a temporary copy of each of Java code template segments (begin, main or end). It then, for every segment and for every attribute of the element, replaces the attribute place-holders with attribute values. Once done, it appends the resulting string to the previously processed Java code.

Attribute place-holders are marked with $ sign. E.g. if we have an attribute memo, then its place-holder in the template segment will be $memo.

Additionally, the content of the import elements will be added to the import declarations of the over-all test case class. If another element has already declared the same import, then the import will be ignored. Similarly, the Exception elements will be added to the exception declarations of the test method.

Example

In this example, we want to build work order change status tag. The tag will have tree attributes: wonum, siteid and status. Additionally, the tag will have an optional element memo. This is what it should look like when used in the test:

<ext:myCo_woChangeStatus wonum="TESTWO1" status="APPR" siteid="BEDFORD">
		<ext:memo>approve memo</ext:memo>
	</ext:myCo_woChangeStatus>

When compiled, we want this code to convert to the following Java code:

{
		String mycoStatus = "APPR";
		String mycoMemo="";
		MboSetRemote mycoWoSet = MXServer.getMXServer().getMboSet("WORKORDER", MXServer.getMXServer().getSystemUserInfo());
		mycoWoSet.setWhere("wonum = '" + "TESTWO1" + "' and siteid = '" + "BEDFORD" + "'");
		mycoWoSet.reset();
		
		WORemote mycoWo = (WORemote) mycoWoSet.getMbo(0);
		mycoMemo="approve memo";
		mycoWo.changeStatus(mycoStatus, MXServer.getMXServer().getDate(), mycoMemo);
		mycoWoSet.save();
	}

Here is a complete commands code that achieves this functionality:

<ext:myCo_woChangeStatus xmlns:ext="http://www.maxtaf.com/ext">

	<!-- declare attributes -->
	<attributes>
		<attribute name="wonum" type="String"/>
		<attribute name="status" type="String"/>
		<attribute name="siteid" type="String"/>			
	</attributes>

	<!-- top section of the Java code. 
		Note how the attribute place-holders are prefixed with $ -->		
	<begin>
	{
		String mycoStatus = $status;
		String mycoMemo="";
		MboSetRemote mycoWoSet = MXServer.getMXServer().getMboSet("WORKORDER", MXServer.getMXServer().getSystemUserInfo());
		mycoWoSet.setWhere("wonum = '" + $wonum + "' and siteid = '" + $siteid + "'");
		mycoWoSet.reset();
			
		WORemote mycoWo = (WORemote) mycoWoSet.getMbo(0);
			
	</begin>

	<!-- Defintion of the optional sub-element memo.
			If present, it will be inserted before the end section
			and after the begin section -->
	<ext:memo>
		<attributes>
			<attribute name="content" type="String"/>
		</attributes>
		mycoMemo=$content;
	</ext:memo>

			
	<!-- bottom section of Java code --> 		
	<end>
		mycoWo.changeStatus(mycoStatus, MXServer.getMXServer().getDate(), mycoMemo);
		mycoWoSet.save();
	}
	</end>

	<!-- imports declaration -->
	<imports>				 
		<import>
			java.rmi.RemoteException
		</import>
		<import>
			psdi.util.MXException
		</import>
		<import>
			psdi.mbo.MboRemote
		</import>
		<import>
			psdi.server.MXServer
		</import>
		<import>
			psdi.mbo.MboSetRemote
		</import>
		<import>
			psdi.mbo.StatefulMboRemote
		</import>
		<import>
			psdi.app.workorder.WORemote
		</import>
	</imports>
	<!-- exception declaration -->

	<exceptions>
			<exception>RemoteException</exception>
			<exception>MXException</exception>
	</exceptions>
	</ext:myCo_woChangeStatus>	
			

Our new element needs to be accompanied with its XSD definition. The XSD definition for this element looks like this:

<?xml version="1.0" encoding="UTF-8"?>
	<schema xmlns="http://www.w3.org/2001/XMLSchema"
		targetNamespace="http://www.maxtaf.com/ext"
		xmlns:tns="http://www.maxtaf.com/ext" elementFormDefault="qualified"
		attributeFormDefault="unqualified">

		
		<element name="myCo_woChangeStatus" type="tns:tMyCo_woChangeStatus"></element>

		<complexType name="tMyCo_woChangeStatus">
			<sequence>
				<element name="memo" minOccurs="0" maxOccurs="1">
					<simpleType>
						<restriction base="string">
							<minLength value="0"></minLength>
						</restriction>
					</simpleType>
				</element>			
			</sequence>
			<attribute name="wonum" use="required">
				<simpleType>
					<restriction base="string">
						<minLength value="0"></minLength>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name="status" use="required">
				<simpleType>
					<restriction base="string">
						<minLength value="0"></minLength>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name="siteid" use="required">
				<simpleType>
					<restriction base="string">
						<minLength value="0"></minLength>
					</restriction>
				</simpleType>
			</attribute>
		</complexType>

	</schema>
			

Let's say that we want to keep all of our custom tags in files called after our company: myco. In that case, we will have the command definitions file myco.xml. This file will hold the content of the XML code from the above section Commands code and it must be kept in the maxtaf/mxml/commands directory.

The XSD content from the above section XSD Definition will be kept in a file named myco.xsd and must be located in the maxtaf/mxml/xsd directory.

Lastly, if we haven't done so before, we must register our XSD file. We do so by editing the file maxtaf/mxml/xsd/ext.xsd where we insert the following code:

<?xml version="1.0" encoding="utf-8"?>
	<xs:schema xmlns:tns="http://www.maxtaf.com/ext" xmlns:t="http://www.maxtaf.com" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.maxtaf.com/ext" xmlns:xs="http://www.w3.org/2001/XMLSchema">
		<xs:include schemaLocation="myco.xsd"/>
	</xs:schema>

In summary, we have added/updated the following files:

		maxtaf/mxml/command/myco.xml
		maxtaf/mxml/xsd/ext.xsd
		maxtaf/mxml/xsd/myco.xsd

That's all. Once you have completed the above steps, you can immediately start using your new element myCo_woChangeStatus in your MXML tests.

In the MXML tests you can reuse the same test segment by utilising the include tag. When the test is compiled, first the include tag is physically replaced with the content of the file that it is pointing to and then it gets compiled as one big test. The resulting effect is the same as if you copy-pasted the content of the file into your test. The benefit of include tag is that you maintain the code that is shared between many different tests in one place only.

To use this tag, first you need to extract the test segment into a separate file.

		<segment xmlns:ui="http://www.maxtaf.com/ui">
			<ui:login></ui:login>
			<ui:changeApp name="wotrack"/>
			<!-- [ click ] button - New Work Order -->
			<ui:click>
			 <ui:xpath>//img[@staticId='toolactions_button_0-toolbarbutton_image_image']</ui:xpath>
			</ui:click>
			<!-- [ click ] toolbarbutton - Save Work Order -->
			<ui:click>
			 <ui:xpath>//a[@staticId='toolactions_button_1-toolbarbutton_image_anchor']</ui:xpath>
			</ui:click>
			<!-- [ click ] button - Approve Work Order -->
			<ui:click>
			 <ui:xpath>//img[@staticId='toolactions_button_14-toolbarbutton_image_image']</ui:xpath>
			</ui:click>
			<!-- [ click ] pushbutton -->
			<ui:click>
			 <ui:xpath>//button[@staticId='changestatus_2_1-pushbutton_pushbutton']</ui:xpath>
			</ui:click>
		</segment>
	

In the above example, we have the test segment that we want to reuse. Like all well-formed XML documents, tags we extracted need to be inside the root tag, called segment.

You need to re-declare all of the namespaces used by the tags inside the segment tag.

Once you created your new file, you can use it in any test by referencing it in the path attribute of the include tag.

		<testCase xmlns="http://www.maxtaf.com" name="Includetest"  xmlns:ui="http://www.maxtaf.com/ui"  xmlns:mif="http://www.maxtaf.com/mif"  xmlns:mbo="http://www.maxtaf.com/mbo"  xmlns:time="http://www.maxtaf.com/time" xmlns:net="http://www.maxtaf.com/net" xmlns:wf="http://www.maxtaf.com/wf" xmlns:db="http://www.maxtaf.com/db" xmlns:ext="http://www.maxtaf.com/ext" >
			<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"/>
			</beforeTestCase>
			<test name="testInclude">
				<addTestReport name="testInclude"/>
				<ui:maximizeWindow />
				<include path="C:/ibm/SMP/maximo/maxtaf/template/woCreate.xml" />
				<!-- [ assertValue ] textbox - Status: APPR -->
				<ui:assertValue value="APPR">
				 <ui:xpath>//input[@staticId='headerA_8-textbox_textbox']</ui:xpath>
				</ui:assertValue>
				<testReportStatus>PASSED</testReportStatus>
			</test>
			<afterTestCase>
				<ui:close/>
				<closeReporter/>
			</afterTestCase>
		</testCase>
	

You can also call include file from another include file. Just bare in mind that your test will not compile if you create a loop in your calling hierarchy (first include file calls the second; second include file calls the first).

The included file WILL NOT pass through the XSD validation. This means that the compiler will not throw any errors if the file included is not up to the MXML XSD specification. Instead the compiler will skip any invalid tags it finds in the included file.


MaxTAF framework runs JUnit tests and as such can be used to execute any browser automation tests that can be embedded into a JUnit class.

However, MaxTAF provides specific support for the Selenium framework, both in the functional extensions and the knowledge base.

When constructing a web page, for performance reasons, Maximo assigns dynamic id's to the page elements. These dynamic id's follow the format mxnnn where nnn is a sequential integer number. Being dynamically generated, these id's are not exclusively assigned to specific elements. E.g. if the New Status element in the dialog Change Status has id of mx1234 when you first open the dialog, it will become something else next time you open the same dialog, like mx9876.

This behaviour makes the browser automation tests rather difficult as it forces the developer to devise other ways of identifying screen elements, like using complicated xpath expressions or similar. Additionally, after every Maximo upgrade, the dynamic ID's are likely to change making the old tests obsolete.

Maximo 7.5 and later offers a system property called staticid, which if switched on, permanently assigns static id's to elements, again in the format mxnnnnnn. Although this function resolves automation problem, it comes with a pay-off on performance level.

MaxTAF resolves this problem by introducing functionality that adds static element id's, but only when a test demands it. Hence, the performance benefits of dynamic id's is still available for regular use of the software. When switched on, the MaxTAF will create a new attribute called staticId to accompany every dynamic id. The value of the staticId element attribute will be the element's id as specified in the application’s presentation XML, basically, the id that you see when in the Application Designer you look at the properties of a screen element.

Example:

In the following example, you can see that the id attribute for the New Status field has changed after the status dialog was re-opened from mx3788 to mx3354. However, the staticId attribute added by MaxTAF filter has stayed the same : changestatus_grid1_1_1_grid4_1-combobox_textbox. (The tool used to display element properties in these examples is the Firebug plug-in for Firefox browser. You can, of course, use any tool of your choice.)

figure 1: New Status element after first invocation of the change status dialog

figure 2: New Status element after the second invocation of the change status dialog

Method 1:

MaxTAF static id is activated through the page url parameter static. If at the end of your Maximo page url you add static=y and reload the page, from that point onward, for the given user session, all the elements with dynamic id’s will also have their static id's as explained above.

Example:

http://localhost:9080/maximo/ui/?event=loadapp&value=wotrack&uisessionid=5&static=y

Once activated, the staticId will be present only for the duration of the user session, meaning that it will be switched off as soon as the session is ended. Therefore you must activate staticid for every new session, in essence, after every new login into Maximo. From testing perspective this means that the test code, when launching the browser, must add static=y at the end of the Maximo URL.

Method 2:

You can permanently switch on the static id by having the property global.static set to "1", in the MaxTAF Administration module.

To switch global static off, either set it to "0" or delete it.

Note: Be aware that assigning static id’s to page elements inevitably requires certain amount of computing power so in performance critical environments you should always use method 1 to activate static id's.

When running Selenium tests in MaxTAF, you have to specify parameters that will enable MaxTAF to issue instructions to the web browser via Selenium facilities.

These parameters can be specified as MaxTAF properties in the MaxTAF Administration application or can be explicitly supplied as test parameters for individual tests. If both exist, the test parameter will take precedence.

MaxTAF administration properties are prefixed with selenium. e.g. selenium.mode or selenium.maximoAddress

MaxTAF UI test parameters list:

Example of UI test parameter list:

		mode=remote
		browser=firefox
		#browser=internetexplorer
		remoteSelenesServerAddress=http://localhost:5555/wd/hub
		maximoAddress=http://localhost:3280/maximo
		username=maxadmin
		password=maxadmin
		slowDownLevel=0
Note how you can comment out the parameter by adding hash (#) in front of it. This can be useful for quickly changing the parameter in use.

Selenium IDE is a plug-in module for FireFox browser that provides many options including the Record and Play functionality.

MaxTAF Recorder is an add-on for Selenium IDE that extends Selenium IDE functionality with the following:

  1. MaxTAF selector: when recording, the Selenium Recorder is instructed to use the MaxTAF staticid element attribute as the main identification method for page elements.
  2. MaxTAF Formatters: export recorded Selenium sessions into ready-to-run MaxTAF java classes or XML files for test import .

UI test case parameters, discussed in the section UI Test Parameters, can be defined directly in Selenium IDE. The parameter values set in the Selenium IDE will be exported with the test script itself. Importing the test script into Maximo, will populate the parameter list of that test case with the values defined.

To define the values of these parameters in your Selenium IDE go to Options > Options... > Formats and then select any format starting with MaxTAF / Import.

All of the export formats that can be imported directly into Maximo has its own parameter list to define. When you install the Selenium IDE plug-in and MaxTAF extension plug-in, this list will be populated with default values as seen on the image above.

To change any of the defined values, simply type new value into the desired field, and click on the OK button. If you want the parameter changed to be the same across all the export formats, then repeat this procedure for all the MaxTAF / Import formats.

Recording new UI tests consists of :

  1. Recording your Maximo UI session using the Selenium IDE.
  2. Exporting the recorded script from IDE into Maximo

To record a Maximo test using Selenium follow these steps:
  1. Open the List screen of the Maximo application you want to test.
  2. If not on, switch the static mode on (see Activating MaxTAF Static Id)
  3. When ready to record, launch SeleniumIDE

    By default, when launched, the SeleniumIDE goes straight into the Record mode. In case you notice that no recording is happening, switch it on manually by clicking the red circle in the upper right corner of the SeleniumIDE window.
  4. Now perform your session in Maximo that you wanted to record. As you click and type around, SeleniumIDE will capture your screen actions and convert them into instructions.
  5. When done, press the record button to stop recording

That's it. Now if you go to MaxTAF > Test Case application and search for a test case with the same name as was your export file, it should show up on the list.

Open this record, and if all is set-up correctly and your Selenium Server is up and running, you should be able to run the Test Case immediately

In addition to the MXML export format, you can also choose:

MaxTAF / Import / Java creates an import file, which when imported into Maximo, creates a Test Case of type Java. These tests have only the Java code and not the MXML code.

MaxTAF / Java creates a file which only contains the Java code of the test. This cannot be imported into Maximo but rather copy-pasted into the Script editor.

MaxTAF / Import / Custom creates an import file using custom formatter. The custom formatter extends the standard MaxTAF / Import / MXML formatter, which can then be customised by the client with client's specific functionality.

Running Selenium tests is no different to running ordinary MaxTAF tests. The following must be in place:

- MaxTAF test parameters are set to the correct values (see section Selenium parameters)

- Selenium server is up and running

The press of the Run Test button will kick

The press of the Run Test button will kick off the Selenium test and a new browser session will be launched by the Selenium server and the test will commence (pay attention to your task bar to see the launch of a new browser session).

The testing of Maximo BIRT reports predominantly consists of asserting the correctness of the data present in the report. When recording your test, you will run the report, and when the output is produced and presented in its separate window, you will use the right click menu options like "assert" and "validate" to evaluate the correctness of a specifc report element (e.g. that the sum total at the bottom of the page is of a specific value, or that the status of a specific work order in the report table is APPR).

The elements in BIRT reports do not have static ids like the elements in other Maximo screens. Consequently, the tests cannot locate the elements in BIRT reports by using the unique identifiers (static id). Instead, the recorder will by default capture the elements position on the page, e.g. 3rd cell of the 2nd row in the 4th table in on the page. This position will be then used to locate the element when we play the test.

However, for the assertion of the data contained within a table, this is not always a reliable way of identifying data elements as their row position within the table is most likely to vary between different runs of the report due to data being added or deleted between runs.

MaxTAF Recorder solves this problem by emulating the way that a human tester locates the data in the report tables.

Let's consider an example of a "Word Order Details" report shown below.

Say that one of the test steps is to assert that the status of the task with id "30" is "INPRG". For a person to check manually the status, the natural proccess would be to first find the row of the table for the "Task ID" = "30" and then look for the value of the "Status" column for that row and confirm that it is "INPRG". For MaxTAF Recorder to emulate this thought process, in addition to asserting the value of the Status cell, it also needs to know which column holds the unique identifier of that row, namely the "Task ID" column in this specific example.

In MaxTAF terminology this column is called Key Column and the Recorder requires you to specify it once the table is interacted with (clicked/right-clicked on). In this example, once you right click the "Status" cell in the table, a popup dialog will show, requesting you to specify the "Key Column name". At this stage, you will type in the "Task ID" and press OK button.

Once the valid column name is entered the dialog will disappear and you can continue with your intended action, e.g. the right-click menu will show up, and you can then select the "assertText" command.

This proccess of Key Column definition is required only once per report table.

Once you've defined the Key Column, the header of that column will be highlighted.

It is possible to change the Key Column for a report table by right clicking anywhere in the table and selecting "changeReportKeyColumn" command.

The functionallity explained above is used by default when recording in the BIRT report window.
If you wish to have a choice whether or not to use this functionallity, you can change the value of the "Switch to BIRT report locators automatically?" checkbox in the "General" tab of the Recorder options.

If this option is turned off, then the Recorder will prompt the user for the decision while recording.


At the run time, the content of the screen element Parameters will be passed on to the JUnit test class.

MXML: 

The test case parameters in MXML have to be in the properties format. This is a standard format for Java properties files where each line holds a name-value pair for a specific property e.g :

siteId=EAGLENA

woPrefix=TESTWO 

To get the content of a specific property, use the getTestParam tag:

	<var name="prefix" type="String">""</var>
	<var	name="mySiteId" type="String">""</var>
	<getTestParam name="woPrefix" variable="prefix" />
	<getTestParam name="siteId" variable="mySiteId" />
	

In this example, the value that the user sets in the Test Case screen, namely EAGLENA for the site id and TESTWO for the work order prefix will be transferred into the mySiteId and prefix MXML variables.

JUnit:

In JUnit test cases, to get the content of the Parameters field, the test class must include a static variable named params:

public static String params;

The precise format of the content of this variable is entirely down to the programmer. For example, it can contain a single value or can contain an XML or properties structures with multiple values.

Example 1: single value

	public static String params;
	…
	String wonum=params;
				

Example 2: properties format

	public static String params;
	public static Properties p = new Properties();

	…

	p.load(new ByteArrayInputStream(params.getBytes()););
	String wonum = p.get("WO").toString();
	String ponum = p.get("PO").toString();
	

Data Driven tests are those that enable repeat execution of the test case but with a different set of predefined test case parameters for each run.

The data sets for the data driven test run are held in the CSV format (comma separated values) in a text file.

Data File:

The data file can be either attached to the Test Case record (via Maximo file attachment) or can be located as a file on a drive that is visible to Maximo.

You specify your data file as a test case parameter.

For the Maximo attachments, the data file is specified in the following test case parameter:

		testData.csvAttachment=attachment_name
where attachment_name is the name you gave to your attachment when attaching the file to the test case record.

For the data files located on a drive, the data file is specified in the following test case parameter:

		testData.csvFilePath=file_path
where file_path is the full path to your file.

Columns:

You need to specify the mapping between your data values and the test case input parameters. For this you use function

		dataSource(column_reference)
where column_reference can be either the title of the column, when such is specified in the first row of the file, or the column's number/position (see below).

To assign this value to a test input parameter, you simply add a line in your test case parameters in the following format:

		input_parameter=dataSource(column_reference)

Example:

Say, that we are testing changing the status of a work order and our data file attached to our test case, under the name of WOCHANGESTATUS, contains the work order number and the status that the work order needs to change to. Your WOCHANGESTATUS data file could look like this:

		"WONUM","STATUS"
		"WO123","APPR"
		"WO345","COMP"

We expect that our on execution of our test case, the test case is executed twice, first time with data of the first data row and the second time from the second row.

Our test case input parameters would look like this:

		testData.csvAttachment=WOCHANGESTATUS
		woNum=dataSource("WONUM")
		newStatus=dataSource("WONUM")

With this set-up, our test case will be executed twice. The first time, woNum input parameter will be set to WO123 and the newStatus will be set to APPR. The second time round, woNum and newStatus will be set to WO345 and COM, respectively.

So, in preparation for the execution of a test case, the system will read the data file. For each row in the data file, it will parse the CSV formatted text and separate data items into column variables. It will then replace column variables in the test case input parameters with their values and will only then execute the test case.

Ways of addressing the data file values in the test case parameters:

1. By Column Title:
If your data file has titles of the columns in the first row then you can address the value from that column in the test case parameters by entering

		dataSource("data_column_name")
Example: dataSource("WONUM")
In this case you must surround data_column_name with double quotes.

2. By Column Position:
If your data file does not have titles of the columns, i.e. the first row contains data. then you can address the value from that column in the test case parameters by entering

		dataSource(data_column_number)

Where data_column_number means the columns position in the data file .
Example: dataSource(3)
In this case you must not surround data_column_number with quotes.

2. By Fixed Position:
You can also address a value of a specific cell in the data file

		dataSource(data_row_number, data_column_number)
Where data_column_number means the cell's column position in the data file, and the data_row_number means the cell's row position in the data file.
Example: dataSource(4,2)
In this case, MaxTAF will always use the value of the second column in the fourth row for all iterations of the test case run.
The row number is absolute irrespective of whether you have a title row or not.

Running Iterations in Parallel:

By default, the execution of the test cases is sequential, meaning that for each row of test data, MaxTAF will execute the test cases one at a time.

MaxTAF also allows simultaneous execution of test cases for all the data rows in the file. To do so, you specify the following parameter in the test case input parameters:
		testData.parallel=true
With this set-up, MaxTAF will launch parallel threads, each one representing a row in the data file.
As each parallel thread requires its own system resources, in case of big data files you may affect system performance, so use this option with care.

MaxTAF provides flexible facilities for reporting on the progression and the outcome of test runs.  

The reports can be in a simple text format, or they can be XML or HTML documents.

In addition to fully constructing and controlling the output in your test class, you can also use the Reporter class which provides ready made templates for some of the most common test reporting needs.

The mechanism in place is fairly simple: during the execution of a report, the developer can store any feedback information in a static string variable called report. Upon the completion, the full content of this variable is saved with the test run log.

When presenting the test run log in the Test application, the following logic applies:

  1. if the report content starts with <?xml it will be categorised as an XML document
  2. if the report content contains <html> it will be categorised as an HTML document
  3. if neither of the above, it will be categorised as a TEXT document

When presenting the report, its content together with the content type label will be passed on to a browser control on the screen which will then render it according to its type.

With this understanding, you can make any reports you like, from simple text reports to complex HTML documents with style sheets, transformations etc.

Although you have the full freedom to develop your own reports and report templates, MaxTAF comes with a predefined set of classes and interfaces for most common test reporting needs.They are used to construct report in XML format. The XML file is then transformed to HTML using XSLT.

Below is a report example. The XML is transformed into HTML using default XSL and CSS. It has header with a title, description, test class, author, test date and status.

After the header there is information about every test executed (in this case only one), with the steps for the test.

There are three interfaces which define the construction of the report XML:

Reporter - for working with XML itself, such as converting XML to string, applying XSL to XML, setting the header information etc.

TestReport - contains methods for manipulation of particular test report. Note that JUnit allows you to have multiple tests within a test class, and therefore you can have multiple test reports.

TestStep - contains the methods for the manipulation of a particular test step (part of test report)

MaxTAF comes with implementations of these interfaces: Reporter, TestReport and TestStep classes. Of course, you can define your own implementations.

Here is how to use these classes:

First you have to initiate Reporter class. The most logical place to do it is in a method annotated either with @BeforeClass or @Before (for more information see Table 1. Annotations),

reporter = new Reporter(String title, String description,
		String className, String author, Date date)

If you wish, after you have initiated Reporter, you can set-up your own custom XSL with the following line of code:

reporter.setXSL(“http://my_xsl_location/my.xsl”);

Otherwise default XSL will be used.

For every test in the test class you have to initiate TestReport object with its constructor:

public CdlTestReport(String testName);

Then you can add individual test steps with:

TestStep addTestStepReport(String number, String action,
		String expected, String actual, String status);

This method returns an instance of the TestStep class. This class holds information on a specific test step in the report. The value of the attribute “Status” that shows the pass/fail outcome of the step can be controlled through the method setStatus(String status):

		TestStep myTestStep = myTest.addTestStepReport("1", "Create	new work order", "New work order is created", "New work order is created", "UNKNOWN");
		//
		// your code which creates new work order
		//
		myTestStep.setStatus("PASSED");

Finally, you have to convert Reporter XML to a string and put it in the static variable report . Best place for doing this is in a method with @AfterClass or @After annotations (for more information see Table 1. Annotations). In this method you should also define the status of whole test case:

		reporter.setStatus("PASSED");
		report = reporter.getXMLString();

As mentioned you can create your own XML transformation and style sheet for the report XML.

The logic is as follows: Reporter will produce an XML output. That XML will point to the XSL transformation file. The XSL transformation will name the CSS style sheet.

In order to customise the report you will produce your own version of the XSL which will point to your own CSS style sheet file. Then in your MaxTAF test code you will associate your XSL with the report using the aforementioned method setXSL();

Below are examples of the default XML, XSL and CSS files used by MaxTAF.

XML:

	<?xml version="1.0" encoding="UTF-8"?>
	<?xml-stylesheet type="text/xsl" href="TestReport.xsl"?>

	<test>
		<header>
			<title>Company Master UI Test</title>
			<description>Test checking if creation of company master records and creation of companies works</description>

<class>rs.cdl.maxtaf.test.CompanyMasterTestUI</class> <author>John Doe</author> <date>22/3/2012</date> </header> <method name="createCompanyMaster1"> <step number="1" action="Log in to Maximo" expected="The Maximo Main Menu will be displayed." actual="As expected" status="Passed" /> <step number="2" action="From the Equipment Module select the Equipment Application." expected="As expected" actual="The Equipment Application screen is displayed." status="Passed" /> <step number="4" action="Click on the ‘Associate Specification Template’ button" expected="The Associate Specification Template screen will be displayed" actual="As expected" status="Passed" /> </method> <method name="createCompanyMaster2"> <step number="1" action="Log in to Maximo" expected="The Maximo Main Menu will be displayed." actual="As expected" status="Passed" /> <step number="2" action="From the Equipment Module select the Equipment Application." expected="As expected" actual="The Equipment Application screen is displayed." status="Passed" /> <step number="4" action="Click on the ‘Associate Specification Template’ button" expected="The Associate Specification Template screen will be displayed" actual="As expected" status="Passed" /> </method>

</test>

XSL:

	<?xml version="1.0" encoding="UTF-8"?>

	<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
		<xsl:template match="/">
			<html>
				<header>
					<link rel="stylesheet" type="text/css" href="TestReport.css" />
					<title>
						<xsl:value-of select="testcase/header/title" />
					</title>
				</header>
				<body>
					<h1>
						<xsl:value-of select="testcase/header/title" />
					</h1>
					<table class="header">
						<tr>
							<td class="title">

Description

</td>

<td>

<xsl:value-of select="testcase/header/description" />

</td>

</tr>

<tr>

<td class="title">

Test Class

</td>

<td>

<xsl:value-of select="testcase/header/class" />

</td>

</tr>

<tr>

<td class="title">

Author

</td>

<td>

<xsl:value-of select="testcase/header/author" />

</td>

</tr>

<tr>

<td class="title">

Date

</td>

<td>

<xsl:value-of select="testcase/header/date" />

</td>

</tr>

<tr>

<td class="title">

Status

</td>

<xsl:if test="testcase/header/status='PASSED'">

<td class="passed">

<xsl:value-of select="testcase/header/status" />

</td>

</xsl:if>

<xsl:if test="testcase/header/status='FAILED'">

<td class="failed">

<xsl:value-of select="testcase/header/status" />

</td>

</xsl:if>

</tr>

</table>

<br />

<xsl:for-each select="testcase/test">

<h2>

Test:

<xsl:value-of select="@name" />

</h2>

<table class="steps">

<tr>

<th>Step</th>

<th>Action</th>

<th>Expected Result</th>

<th>Actual Result</th>

<th>Status</th>

</tr>

<xsl:for-each select="step">

<tr>

<td>

<xsl:value-of select="@number" />

</td>

<td>

<xsl:value-of select="@action" />

</td>

<td>

<xsl:value-of select="@expected" />

</td>

<td>

<xsl:value-of select="@actual" />

</td>

<xsl:if test="@status='PASSED'">

<td class="passed">

<xsl:value-of select="@status" />

</td>

</xsl:if>

<xsl:if test="@status='FAILED'">

<td class="failed">

<xsl:value-of select="@status" />

</td>

</xsl:if>

</tr>

</xsl:for-each>

</table>

<br />

</xsl:for-each>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

and the CSS file:

		body {
			font-family: arial, sans serif, verdana;
			font-size: 12px;
			padding: 0 10px 10px 10px;
		}
		h1 {
			font-family: verdana, arial, sans serif;
			color: #333300;
			font-weight: bold;
			font-size: 125%;
		}
		h2 {
			font-family: verdana, arial, sans serif;
			color: #999999;
			font-weight: bold;
			font-size: 125%;
		}
		table.header {
			border: 1px solid;
			margin: 0;
			padding: 0;
			border-collapse: collapse;
		}
		table.header tr {
			border: 1px solid black;
		}
		table.header tr td {
			border: 1px solid black;
			color: black;
			margin: 0;
			padding: 5px;
		}
		table.header tr td.title {
			background-color: #666699;
			border: 1px solid black;
			font-weight: bold;
			color: white;
			margin: 0;
			padding: 5px;
			text-transform: uppercase;
		}
		table.steps {
			border: 1px solid;
			margin: 0;
			padding: 0;
			border-collapse: collapse;
		}
		table.steps tr {
			border: 1px solid black;
		}
		table.steps tr th {
			background-color: #333300;
			border: 1px solid black;
			color: white;
			margin: 0;
			padding: 5px;
			text-transform: uppercase;
		}
		table.steps tr td {
			border: 1px solid black;
			color: black;
			margin: 0;
			padding: 5px;
		}
		table.header tr td.passed {
			font-weight: bold;
			color: green;
		}
		table.header tr td.failed {
			font-weight: bold;
			color: red;
		}
	

There are three places where you can keep your XSL and CSS files:

1. in Maximo Doclinks folder

2. in the EAR file in MaximoUIWeb/WebClient directory

3. at an external internet location


MaxTAF enables independent tests that belong to the same test suite, to exchange information during the suite run.

This is particularly useful when tests are logically sequenced. Example: the first test in a suite creates a work order and the second test approves the work order. The work order number is auto generated by Maximo, so you need to pass the generated work order number from the first test to the second test in order for the second test to know which work order to approve.

MXML:

In MXML test cases, use apInput and apiOutput tags.

These tags are used for exchanging values between test cases in a suite.

The apiOutput takes the value of the variable specified in the var attribute and passes it on to the next test case in the test suite.

The apiInput tag 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.

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"/>
		

JUnit:

In java test cases, the test class can include the two specialized Object variables called apiInput and apiOutput:

			public static Object apiInput;
			public static Object apiOutput;
		

At a suite run, the value of the apiOuput variable of the previous test will be passed into the apiInput variable of the next test.

For example the first test can have the following code:

			MboRemote myWo = myWoSet.add();
			apiOutput = myWo;
		

and the second test can have:

			MboRemote woToApprove = apiInput;
		

If you need to pass more than one object, you can use various Java collections on offer, like ArrayList.


REST API is part of Maximo Intergation framework, which allows for external application integration.
MaxTAF supports execution of existing test cases and retrieval of test run logs through REST, by using standard HTTP POST method.

To compile a test case, send POST request to the following URL:

			http://maximoaddress/maxrest/rest/mbo/cdlmcompileresult
		

where maximoaddress should be your Maximo URL (eg. localhost:9080/maximo).


It is required for the POST request to include the following HTTP header:

x-http-method-override:compileTest
This header annotates the method executed, which in this case is compileTest method.

Accepted POST parameters are:


Script sent through request must be URL encoded. Example:

~script=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CtestCase%20xmlns%3D%22http%3A%2F%2Fwww.maxtaf.com%22%20xmlns%3Aui%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fui%22%20xmlns%3Amif%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fmif%22%20xmlns%3Ambo%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fmbo%22%20xmlns%3Atime%3D%22http%3A%2F%2Fwww.maxtaf.com%2Ftime%22%20xmlns%3Anet%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fnet%22%20xmlns%3Awf%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fwf%22%20xmlns%3Adb%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fdb%22%20xmlns%3Aext%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fext%22%20name%3D%22asserttitletest%22%3E%0A%20%20%3CbeforeTestCase%3E%0A%20%20%20%20%3CaddReporter%20type%3D%22xml%22%20name%3D%22Assert%20title%20test%22%20description%3D%22%20%22%20class%3D%22asserttitletest%22%20author%3D%22%20%22%20%2F%3E%0A%20%20%3C%2FbeforeTestCase%3E%0A%20%20%3Ctest%20name%3D%22testasserttitletest%22%3E%0A%20%20%20%20%3CaddTestReport%20name%3D%22Assert%20title%20test%22%20%2F%3E%20%20%09%0A%09%3Cui%3AassertTitle%20title%3D%22Work%20Order%20Tracking%22%20%2F%3E%0A%20%20%20%20%3CtestReportStatus%3EPASSED%3C%2FtestReportStatus%3E%0A%20%20%3C%2Ftest%3E%0A%20%20%3CafterTestCase%3E%0A%20%20%20%20%3CcloseReporter%20%2F%3E%0A%20%20%3C%2FafterTestCase%3E%0A%3C%2FtestCase%3E
URL encoding converts characters into a format that can be transmitted over the Internet.
To URL encode parameter list (like the one in the test case parameter field) you can use online URL Encoder/Decoder from here.


Complete test compilation example:
Content of the batch file that uses CURL library to execute POST request:

			start curl -d "_lid=maxadmin&_lpwd=maxadmin&~testNum=ASSERTTITLE&~script=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CtestCase%20xmlns%3D%22http%3A%2F%2Fwww.maxtaf.com%22%20xmlns%3Aui%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fui%22%20xmlns%3Amif%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fmif%22%20xmlns%3Ambo%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fmbo%22%20xmlns%3Atime%3D%22http%3A%2F%2Fwww.maxtaf.com%2Ftime%22%20xmlns%3Anet%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fnet%22%20xmlns%3Awf%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fwf%22%20xmlns%3Adb%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fdb%22%20xmlns%3Aext%3D%22http%3A%2F%2Fwww.maxtaf.com%2Fext%22%20name%3D%22asserttitletest%22%3E%0A%20%20%3CbeforeTestCase%3E%0A%20%20%20%20%3CaddReporter%20type%3D%22xml%22%20name%3D%22Assert%20title%20test%22%20description%3D%22%20%22%20class%3D%22asserttitletest%22%20author%3D%22%20%22%20%2F%3E%0A%20%20%3C%2FbeforeTestCase%3E%0A%20%20%3Ctest%20name%3D%22testasserttitletest%22%3E%0A%20%20%20%20%3CaddTestReport%20name%3D%22Assert%20title%20test%22%20%2F%3E%20%20%09%0A%09%3Cui%3AassertTitle%20title%3D%22Work%20Order%20Tracking%22%20%2F%3E%0A%20%20%20%20%3CtestReportStatus%3EPASSED%3C%2FtestReportStatus%3E%0A%20%20%3C%2Ftest%3E%0A%20%20%3CafterTestCase%3E%0A%20%20%20%20%3CcloseReporter%20%2F%3E%0A%20%20%3C%2FafterTestCase%3E%0A%3C%2FtestCase%3E" --header "x-http-method-override:compileTest" http://localhost:9080/maxrest/rest/mbo/cdlmcompileresult
		
CURL is an open source command line tool for transferring data with URL syntax. You can find more about it here.
This code will set the script for ASSERTTITLE test case and then compile it.
Response from the POST request is the compile result in XML format.
<?xml version="1.0" encoding="UTF-8"?>
<CDLMCOMPILERESULT xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" rowstamp="[0 0 0 0 0 60 -61 -8]">
    <CDLMCOMPILERESULTID>1025</CDLMCOMPILERESULTID>
    <HASLD>0</HASLD>
    <JAVACODE>import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.openqa.selenium.JavascriptExecutor;
import rs.cdl.maxtaf.api.UiBot;
import rs.cdl.maxtaf.selenium.WebDriver;
import rs.cdl.util.Reporter;
import psdi.iface.jms.JMSData;
import rs.cdl.app.maxtaf.IMessageListener;
import rs.cdl.maxtaf.TestProperties;
import java.util.ArrayList;
import java.util.Date;
import rs.cdl.util.SimpleReporter;
import rs.cdl.util.XMLReporter;
import rs.cdl.util.SimpleTestReport;
import rs.cdl.util.XMLTestReport;
import rs.cdl.util.TestReport;
import org.junit.Assert;
import rs.cdl.util.TestReport;

public class asserttitletest implements IMessageListener {



		public static String params;
		public static String report = "";
		public static Object apiInput;
		public static Object apiOutput;
		private static UiBot bot;
		private static WebDriver driver;
		private static JavascriptExecutor js;
		private static Reporter reporter;
		boolean receivedMessage = false;
		private static String cdlmReportStatus = "FAILED";
		private static TestProperties testProperties;
		private JMSData jmsData = null;
		private static ArrayList&lt;String&gt; verificationErrors = new ArrayList&lt;String&gt;();
		private static int timeOut = 0;




	@BeforeClass
	public static void beforeTestCase() { 
		if("xml".equalsIgnoreCase("xml")){
			reporter = new XMLReporter("Assert title test", " ", "asserttitletest", " ", new Date());
		} else {
			reporter = new SimpleReporter();
		}
	}

	@Test
	public void testasserttitletest() { 
		TestReport testReport;
		if (reporter instanceof XMLReporter) {
			testReport = new XMLTestReport("Assert title test");
		} else {
			 testReport = new SimpleTestReport("Assert title test");
		}
		reporter.addTestReport(testReport);
		{
			String cdlmTitle = bot.getTitle();
			if(!cdlmTitle.equals("Work Order Tracking")){
				testReport.addTestStepReport("Checking page title", "Checking if page title is " + "Work Order Tracking", "Page title is not: " + "Work Order Tracking" + ", it is: " + cdlmTitle, "FAILED");
				cdlmReportStatus = "FAILED";
				Assert.fail("Work Order Tracking" + " is not the title of the page. The title is " + cdlmTitle);
			}
		}
		cdlmReportStatus = "PASSED";
	}

	@AfterClass
	public static void afterTestCase() { 
		reporter.setStatus(cdlmReportStatus);
		report = reporter.getReportString();
	}

	public void onMessage(JMSData jmsData) {
		this.jmsData = jmsData;
		receivedMessage = true;
	}


}</JAVACODE>
</CDLMCOMPILERESULT>
		
If the compilation fails for any reason you will get error message within XMLCOMPILEERROR and/or JAVACOMPILEERROR tags.


To execute existing test case, send POST request to the following URL:

			http://maximoaddress/maxrest/rest/mbo/cdlmtestrunlog
		

where maximoaddress should be your Maximo URL (eg. localhost:9080/maximo).


It is required for the POST request to include the following HTTP header:

x-http-method-override:runTest
This header annotates the method executed, which in this case is runTest method.

Accepted POST parameters are:


By using request parameter ~params you can override existing test case parameters. These parameters are temporary and will not be saved in the test case.
Parameters sent through request must be URL encoded. Example:

~params=mode%%3Dremote%%0Abrowser%%3Dfirefox%%0AremoteSelenesServerAddress%%3Dhttp%%3A%%2F%%2Flocalhost%%3A5555%%2Fwd%%2Fhub%%0AmaximoAddress%%3Dhttp%%3A%%2F%%2Flocalhost%%3A3680%%2Fmaximo%%0Ausername%%3Dmaxadmin%%0Apassword%%3Dmaxadmin%%0AslowDownLevel%%3D0%%0AcompMasterName%%3DtestREST
URL encoding converts characters into a format that can be transmitted over the Internet.
To URL encode parameter list (like the one in the test case parameter field) you can use online URL Encoder/Decoder from here.


Complete test execution example:
Content of the batch file that uses CURL library to execute POST request:

			start curl -d "_lid=maxadmin&_lpwd=maxadmin&~testNum=companymasterui&~params=mode%%3Dremote%%0Abrowser%%3Dfirefox%%0AremoteSelenesServerAddress%%3Dhttp%%3A%%2F%%2Flocalhost%%3A5555%%2Fwd%%2Fhub%%0AmaximoAddress%%3Dhttp%%3A%%2F%%2Flocalhost%%3A3680%%2Fmaximo%%0Ausername%%3Dmaxadmin%%0Apassword%%3Dmaxadmin%%0AslowDownLevel%%3D0%%0AcompMasterName%%3DtestREST" --header "x-http-method-override:runTest" http://localhost:9080/maxrest/rest/mbo/cdlmtestrunlog
		
CURL is an open source command line tool for transferring data with URL syntax. You can find more about it here.
This script runs the COMPANYMASTERUI test case.
Response from the POST request is the test run log in XML format. The response is identical to the report log that you can find and export from Test Case application.
<?xml version="1.0" encoding="UTF-8"?><CDLMTESTRUNLOG xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" rowstamp="19461239"><CDLMTESTRUNLOGNUM>9471</CDLMTESTRUNLOGNUM><CDLMTESTNUM>COMPANYMASTERUI</CDLMTESTNUM><EXECUTIONTIME>39.816</EXECUTIONTIME><RUNCOUNT>1</RUNCOUNT><FAILURECOUNT>0</FAILURECOUNT><RUNDATE>2014-04-07T12:53:45+02:00</RUNDATE><LOG><?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='TestReport.xsl'?>
<testcase>
  <header>
    <title>Test Title</title>
    <description>Test Description</description>
    <class>Test Class</class>
    <author>Autor</author>
    <date>2014-04-07 12:53:16</date>
    <status>PASSED</status>
  </header>
  <test name="testCompanyMasterUI">
    <step number="1" action="Login into Maximo" expected="Start center displayed" actual="Start center displayed" status="PASSED" />
    <step number="2" action="Open Company Master app" expected="Company Master app opened" actual="Company Master app opened" status="PASSED" />
    <step number="3" action="Insert new Comp Master" expected="Company Master created" actual="Company Master created" status="PASSED" />
    <step number="4" action="Set Id" expected="Company Master id set to id 368" actual="Company Master id set to testREST368" status="PASSED" />
    <step number="5" action="Create Company form Company Master" expected="Company created" actual="Company created" status="PASSED" />
  </test>
</testcase></LOG><PARAMS>mode=remote
browser=firefox
remoteSelenesServerAddress=http://localhost:5555/wd/hub
maximoAddress=http://localhost:3680/maximo
username=maxadmin
password=maxadmin
slowDownLevel=0
compMasterName=testREST</PARAMS><TESTCLASS>com.example.tests.CompanyMasterUI</TESTCLASS><CDLMTESTRUNLOGID>10162</CDLMTESTRUNLOGID><HASLD>0</HASLD><LANGCODE>EN</LANGCODE></CDLMTESTRUNLOG>
		
You can execute multiple tests in parallel by sending multiple POST request at the same time.

If the test you executed failed and you want to get failure log of that test run, you can do that by sending POST request to following URL:

			http://maximoaddress/maxrest/rest/mbo/cdlmfailurelog
		
where maximoaddress should be your Maximo URL (eg. localhost:9080/maximo).


HTTP header to include is:

x-http-method-override:getTestFailures

Accepted POST parameters are:

The parameter ~testRunNum is provided in the test execution response XML as the value in the <cdlmtestrunlognum> tag.


Complete failure log retrieval example:
Content of the batch file that uses CURL library to execute POST request:

			curl -d "_lid=maxadmin&_lpwd=maxadmin&~testRunNum=9471" --header "x-http-method-override:getTestFailures" http://localhost:9080/maxrest/rest/mbo/cdlmfailurelog
		
Response XML will contain failure records identical to those in Test Case application:
<?xml version="1.0" encoding="UTF-8"?><CDLMFAILURELOGMboSet rsStart="0" xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><CDLMFAILURELOG xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><CDLMFAILURELOGNUM>3700</CDLMFAILURELOGNUM><CDLMTESTRUNLOGNUM>9407</CDLMTESTRUNLOGNUM><STACKTRACE>java.lang.NullPointerException
	at com.example.tests.CompanyMasterUI.afterTestCase(CompanyMasterUI.java:1292)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.junit.internal.runners.ClassRoadie.runAfters(ClassRoadie.java:65)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:40)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)
	at org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:28)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:109)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:100)
	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:60)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:204)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:143)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:139)
	at rs.cdl.maxtaf.thread.TestThread.runTest(TestThread.java:51)
	at rs.cdl.maxtaf.thread.TestThread.run(TestThread.java:20)</STACKTRACE><TESTHEADER>com.example.tests.CompanyMasterUI</TESTHEADER><CDLMFAILURELOGID>4483</CDLMFAILURELOGID><HASLD>0</HASLD><LANGCODE>EN</LANGCODE><FAILUREMESSAGE>Test failed at line: 1292.
Failure message: null</FAILUREMESSAGE></CDLMFAILURELOG><CDLMFAILURELOG xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><CDLMFAILURELOGNUM>3699</CDLMFAILURELOGNUM><CDLMTESTRUNLOGNUM>9407</CDLMTESTRUNLOGNUM><STACKTRACE>org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1 build 7601 Service Pack 1', java.version: '1.6.0'
Driver info: driver.version: RemoteWebDriver
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
	at rs.cdl.maxtaf.selenium.RemoteWebDriver.<init>(RemoteWebDriver.java:29)
	at rs.cdl.maxtaf.selenium.SeleniumUtil.createDriver(SeleniumUtil.java:117)
	at com.example.tests.CompanyMasterUI.beforeTestCase(CompanyMasterUI.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)
	at org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:28)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:109)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:100)
	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:60)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:204)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:143)
	at rs.cdl.app.maxtaf.CdlmTestRunLog.runtest(CdlmTestRunLog.java:139)
	at rs.cdl.maxtaf.thread.TestThread.runTest(TestThread.java:51)
	at rs.cdl.maxtaf.thread.TestThread.run(TestThread.java:20)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:5555 refused
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
	at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151)
	at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
	at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:316)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:295)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
	... 24 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:363)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:225)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:212)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
	at java.net.Socket.connect(Socket.java:539)
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
	... 32 more</STACKTRACE><TESTHEADER>com.example.tests.CompanyMasterUI</TESTHEADER><CDLMFAILURELOGID>4482</CDLMFAILURELOGID><HASLD>0</HASLD><LANGCODE>EN</LANGCODE><FAILUREMESSAGE>Test failed at line: 61.
Failure message: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1 build 7601 Service Pack 1', java.version: '1.6.0'
Driver info: driver.version: RemoteWebDriver</FAILUREMESSAGE></CDLMFAILURELOG></CDLMFAILURELOGMboSet>
		


When compiling, you can use any additional library (jar or zip file) if needed.

To set an additional library file, you need to add a new property from the MaxTAF Administration application. To open this application use: Go To > MaxTAF > MaxTAF Administration

Use New Row to add a property and set the following fields:

  1. Property Name:lib.nnn, where nnn is the string representing sequential number of your library file, starting with '001' to '999', e.g. lib.001, lib.002, …, lib.999
  2. Description: description of your library file
  3. Value: full file name of your library, e.g. c:\maxtaftests\j2ee.jar. The full file name includes the path to the file.
  4. Leave other fields as defaulted by Maximo

Make sure that you do not skip numbers when adding new libraries as they will not be loaded when your test class is compiled.