MTA Mendix Frontend Testkit
Purpose
The MTA Mendix Frontend Testkit is a Mendix Add-on module built and maintained by Menditect, as a translator from generic Playwright Testing to specific Mendix App Frontend testing.
It extends the functionality of Microflows from the Playwright Connector and allows a Tester to Locate a Widget on a Mendix Page and perform an Action on it.
Properties
Domain model
Some relevant entities are explained here. Note that specific Entity and Attribute documentation is also shown in MTA.
MxLocator, this contains the definition of the Playwright Locator for the Mendix Widget. TheMxLocatoris always 1 on 1 associated with aLocatorobject from the Playwright Connector module. MxLocator Objects are persisted, for the duration of the Test, and deleted when stopping the test. This allows for a MxLocator to be used in subsequent Test Cases. TheMxLocatoris the generalization for all Mendix Widget specific Locator entities in the domain model.MxParentWidgetLocator, specializes fromMxLocator. The specialization means that the respective Mendix Widget can behave as a parent, thus contain other Mendix Widgets, and the context is always a single Object. TheMxParentWidgetLocatoris the generalization for specific parent Locators, for exampleMxContainerLocatorandMxListViewItemLocator.MxParentMultiWidgetInstanceLocator, specializes fromMxLocator. The specialization means that the respective Mendix Widget can behave as a parent, thus contain other Mendix Widgets, and the context is always a List of Objects. TheMxParentMultiWidgetInstanceLocatoris the generalization for specific list-parent Locators, for exampleMxDataGrid2Locator.
Microflows
Some relevant microflows are explained here. Note that specific Microflow and Microflow parameter documentation is also shown in MTA.
Note that some Microflows contain an Options parameter. This parameter can be left Empty when using the Microflow in MTA, but it allows for setting specific options for that microflow.
Start_MxFrontend_Test_With_LoginandStart_MxFrontend_Test_Without_Login, these are used to start a Mendix specific Frontend test, instead of theCreate_BrowserContextandCreate_Pagemicroflows from the Playwright Connector module.Locate_MxPage, this is used to Locate the Mendix Page on the Playwright Page. On showing the Homepage, and whenever a new Mendix Page is shown, this microflow has to be called first, in order to Locate Widgets on the respective Mendix Page.Stop_MxFrontendTestis used to stop a Mendix specific Frontend test, instead of theDelete_...microflows from the Playwright Connector module.Widget_Locators, this folder contains Locator microflows specifically for Mendix Widgets.Widget_Element_Operators, this folder contains Filter microflows specifically for Mendix Widgets.Widget_Asserts, this folder contains Assertion microflows specifically for Mendix Widgets.Widget_Actions, this folder contains Action microflows specifically for Mendix Widgets.
Usage
At least all Mendix Platform supported Widgets are supported. To see an up-to-date list of Mendix Platform supported Widgets: https://marketplace.mendix.com/link/supporttype/Platform
For a comprehensive list of Widgets that can be Located, checkout the Widget_Locators folder in the module. Consult the How-to pages to learn how to build a custom MTA Mendix Frontend Testkit, if the Widget is not in this list.
Locating a Widget is made as simple as possible by Menditect: use the microflows and entities from the MTA Mendix Frontend Testkit. It is possible to create the Teststeps manually, but it is easier to use the MTA build-in feature that generates the Teststeps for you.
By default, when a Locator microflow is executed, MTA will perform an IsVisible Assertion. If the element is not visible on the Page, the test will fail. This allows for early detection if Locator might fail. To disable this, use the IsVisibleOptions parameter of the Locator microflow.
1. Determine Widget Name
The first step is to determine the name of the Widget, for example actionButton1, on the Page.
For Mendix developers, the easiest way is to open the Page in Studio Pro and find the name by opening the Properties: https://docs.mendix.com/refguide/common-widget-properties/#name
For Testers who do not use Studio Pro, it is recommended to use one of the MTA Widget Finder created by Menditect to extract the Widget name from the mx-name-widgetName123 in the CSS.
2. Determine parent element
The parent is the encompassing element that the Widget from step 1 is in. In order to Locate any Widget using the Playwright Testkit, a parent element needs to be passed as a microflow parameter. In the Playwright Testkit, every element that can be a potential parent element is a specialization of the MxParentWidgetLocator entity.
- Example: microflow
Locate_MxWidget_Button, usesMxParentWidgetLocatoras parent element parameter andWidgetNameas the Widget determining Locator parameter.
In most cases, the Mendix Page can be used, meaning that the MxPageLocator object from the Locate_MxPage microflow can be passed.
Note that even though the encompassing element on the Mendix Page is not the Page itself, it is still possible to use the MxPageLocator object, if the encompassing element does not influence the multiplicity or visibility of the Widget itself. This is the case for Containers, Layout Grids, Dataviews etc.
You will not find these Widgets as specializations of the MxParentWidgetLocator entity in the Playwright Testkit's domain model.
If the encompassing element is a Datagrid, Listview, Tabcontainer, Template Grid, etc., these will influence either the multiplicity or visibility of the Widget, and you have to add more Locators, to be more specific.
You will find these Widgets as specializations of the MxParentWidgetLocator entity in the Playwright Testkit's domain model.
In this situation, you have to add at least two more Teststeps:
- Find the Locator for the encompassing element, using step 1.
- Perform a Filter action; filter by text, by row number, etc.
Example:
| Parent Widget | 1. Widget Locator microflow | 2. Widget Filter microflow |
|---|---|---|
| Datagrid | Locate_MxWidget_DataGrid | Filter_DataGrid_Rows_by_Text |
| Listview | Locate_MxWidget_ListView | Filter_ListView_Items_by_Text |
| Tabcontainer | Locate_MxWidget_TabContainer | Filter_TabContainer_Tabs_by_Text or Nth_TabContainer_Tab |
| Template Grid | Locate_MxWidget_TemplateGrid | Filter_TemplateGrid_Items_by_Text or Filter_TemplateGrid_Items_by_Index |
After these "parent" Locator and optional Filter Teststeps are added, it is now possible to add the Locator Teststep for the Widget itself.
Snippets are not rendered as HTML elements by Mendix, even though Mendix does allow for adding a Class to a Snippet. In order to define Locators for Widgets inside a Snippet, add a surrounding Container rendered as a DIV element, with a representable name, to locate it.
Installation instructions
- Download the Mendix Frontend Testkit from the Mendix Marketplace: https://marketplace.mendix.com/link/component/206637
- To enable Mendix App Frontend Testing, you must Enable Loading Pages and Widgets on the Mendix App.
- To test a Mendix Page, you must fill in the Page Class.
Update instructions
Replace the existing module when importing a new version.
Dependencies
These modules are required to be imported in the Mendix App under test:
Make sure to convert widgets to React widgets if React is enabled for the Mendix project.
Feedback?
Are you missing a Mendix Widget? Let us know by submitting a Feature Request!
Last updated: 17 September 2025