There are some tools that come with Dynamics AX such as Task Recorder and you can code them by hand using CodedUI tests written using Visual Studio.
Another option would be Rapise, it provides a robust UI testing capability for Dynamics AX 2009, 2012, AX7/365 and CRM.
Someone mentioned that UI testing is not a recommended best practice. I would partly disagree, the key is to automate the right UI tests, focus on the 20% that is repetitive, mindless and ties up your testers. Don’t try and automate everything, that is the mistake that gives automated testing a bad name IMHO!