Management Center test automation framework

You can use the test automation framework to write test cases that validate the Management Center model, services, and object definitions. The test framework is not intended to validate Management Center user interface widgets, such as properties views and list views.

The test automation framework uses an XML file that describes the list of actions that you want to run. To point to the XML file that contains the actions you want to run, add a URL parameter that is named testdata to the Management Center URL. For example:
https://<host>:8000/lobtools?testdata=/testdata/MyCompany/test.xml
This URL runs the actions in the XML file, test.xml, which is in the following directory:
WCDE_installdir\workspace\LOBTools\WebContent\testdata\MyCompany
The test automation framework manages a collection of named values that can be accessed by the actions that are specified in the XML file. Named values are set by the AutoSetValueAction action or by passing in the value as a URL parameter named testdata.param, where param is the name of the value. For example, to set the storeIdentifier value for a store to Aurora, add the testdata.storeIdentifier=Aurora URL parameter to launch the test.xml file with these values:
https://<host>:8000/lobtools?testdata=/testdata/MyCompany/test.xml&testdata.storeIdentifier=Aurora
After you log in to Management Center, the test automation framework loads the specified XML file and runs the actions that are contained in the file. For example, the following URL opens Management Center and loads the test.xml test file:
https://<host>:8000/lobtools?testdata=/testdata/MyCompany/test.xml
The automated testing continues until an error occurs or all of the actions are completed. After automated testing stops, use one of the following methods to find more detailed information about the execution of each test step:
  • View the Management Center message console to view any messages about the major steps of your automated testing. For more information, see Recovering from errors.
  • If logging and tracing for Management Center is enabled, review the trace.log file to obtain more information about each test step.
For more information about enabling logging and tracing, see Enabling Management Center client-side logging and tracing.

XML file structure

By default, WebSphere Commerce provides test case XML files that you can run to validate your Management Center services and defintions. Some of the the test case XML files are included in restricted directories for each Management Center component within the workspace_dir\LOBTools\WebContent\testdata\commerce directory. Do not modify or add test case files to any restricted directories. Add any new test case XML file to directories that are not restricted within the parent testdata directory.

The test automation XML file must contain a root element named <testcase>. Declare actions as children of the root testcase element by using the <action> element. Each action element must define the name and package of the action to run. To provide instructions for the action, declare parameter, <param>, elements as children of the <action> element. Parameter elements use the following attributes:
1 name
The name of the parameter.
2 value
The value for the parameter.
The following code snippet shows a test case that contains two actions. The first action sets a value that is named storeIdentifier to be Aurora. The second action runs another XML file, test.xml, which is in the /testdata/commerce/catalog/restricted directory.

<testcase>
  <!-- Set a store value -->
  <action name="cmc/automation/AutoSetValueAction">
    < param 1 name="valueKey" 2 value="storeIdentifier"/>
    < param name="value" value="Aurora"/>
  </action>
	 
  <!-- Run Catalog tool testcase -->
  <action name="cmc/automation/AutoRunTestCaseAction">
    <param 1 name="url" 2 value="/testdata/commerce/catalog/restricted/test.xml"/>
  </action>
</testcase>
The test automation framework supports the following actions: