MTA Playwright Connector
Purpose
The MTA Playwright Connector is a Mendix Add-on module built and maintained by Menditect, as a wrapper for Playwright Java commands.
The Playwright Connector makes it possible to define and run a Frontend test in MTA, from any Mendix App. It enables the App to connect to a Playwright Browser, based on specified connection settings, and execute the test. The module is essentially a wrapper around Playwright Locators, Assertions and Actions. These are executed as Java Actions inside a Microflow, which in turn can be executed by MTA. Because these actions are generic, the module can be used to frontend test any webapplication, not just Mendix Apps.
Properties
Domain model
Some relevant entities are explained here. Note that specific Entity and Attribute documentation is also shown in MTA.
Browser, this is the Playwright Browser definition that is created when starting the test with one of theStart_Frontend_Test...microflows. This allows for setting theBrowserTypeand the default waiting time between Playwright Actions, using theLocalStartOptionsnon persistable entity.BrowserContext, this allows for setting a default timeout for Playwright Commands, using theNewBrowserContextOptionsnon persistable entity.Page, this contains the definition for the Playwright Page. The Page is in fact the Browser Tab that is created upon setup. Page Objects are persisted, for the duration of the Test, and deleted when stopping the test. This allows for a Page to be used in subsequent Test Cases.Locator, this contains the definition of the Playwright Locator. Locator Objects are persisted, for the duration of the Test, and deleted when stopping the test. This allows for a Locator to be used in subsequent Test Cases.
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_Frontend_Test...either one of these 3 microflows is called first when starting a Frontend Test, in order to create the Browser object.Create_BrowserContextis called next, creating theBrowserContextobject.Create_Pageis called next, creating thePageobject.Delete_...in theDeletionfolder, these are used to stop the test.Teardown_Playwrightis used to remove Playwright from memory.
Locator microflows are inside the Microflows/Commands/Get_Locator_By... folders.
- The
Get_Locator_By_Pagefolder contains Locators that have the complete Browser Page as scope to locate any HTML element. - The
Get_Locator_By_Locatorfolder contains the same Locators, but using another Locator that narrows the scope within to locate the HTML element. - Another way to narrow down the list is using the microflows inside the
Locator_Element_Operationsfolder, containing Filters and Nth element locators. In order to use XPath or CSS Locators, use the...Get_By_Selectormicroflows.
Assertion microflows are in the Locator_Assertions folder.
Action microflows are in the Locator_Actions folder. Note that some Actions will wait for the element to become visible, others (like "Locator_Element_Count") will be executed immediately. If it is required to wait, it is recommended to use the "Delay after execution" property on the Teststep in MTA that calls the Locator Action microflow.
For more advanced usage, checkout the Playwright documentation for Locators and Actions.
Installation instructions
- Download the Playwright Connector module from the Mendix Marketplace: https://marketplace.mendix.com/link/component/214764
- To start Frontend Testing, you must host a Playwright Browser.
Update instructions
Replace the existing module when importing a new version. When running the Playwright Browser from within your Mendix project, make sure to check which Playwright version is supported by the Playwright Connector.
Make sure to delete any old JAR files from the userlib subfolder in your project directory.
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 Playwright Java command? Let us know by submitting a Feature Request!
Last updated: 17 September 2025