You can use the Application Test Suite: https://www.mendix.com/application-platform-as-a-service/application-test-suite/
This is an tool that enables you to record test scripts by using a Mendix Application. To execute the test scripts it uses Selenium compatible test runners like BrowserStack or SauceLabs.
Optionally you can also use selenium to do functional testing of your Mendix pages.
Also, a webinar is available on this topic which also contains Automated testing options and an introduction to using Selenium and TestNG:
In addition to Andrej's reply, Mendix also has a module to facilitate unit testing, see here.