EasyRepro is an automated UI testing API from Microsoft tool to test Dynamics 365 Power Apps. This is useful if you are performing repeated UI tests and would like to automate these.
To use EasyRepro, go to the GitHub repository https://github.com/microsoft/EasyRepro and download or clone the code:
I will download it:
After downloading the ZIP file, right-click -> Properties and unblock:
Unzip and you should see something like below. Open the solution in Visual Studio:
Go to the NuGet Package Mangaer:
Now update the app.config file in the Microsoft.Dynamics365.UIAutomation.Sample project. Change:
- OnlineUsername, e.g. admin@CRM921352.onmicrosoft.com
- OnlinePassword, e.g. yourpassword
- OnlineCrmUrl, e.g. https://org5fd6d5d1.crm.dynamics.com/
Go to Test->Windows->Test Explorer:
You should see something like:
We will run CreateAccountUCI, which will create an account in the UCI interface of D365:
Note, double-clicking on UCITestCreateAccount takes you to the test method and code:
We can see we are logging in, opening the Sales app, opening Accounts, clicking New, entering a random Name, and Saving:
Let’s run the test:
On running this, I get an error it requires Chrome 85 – System.InvalidOperationException: ‘session not created: This version of ChromeDriver only supports Chrome version 85 (SessionNotCreated)’:
On updating to the latest Chrome version we can rerun without errors.
Here’s what happens when we run this.The Chrome browser opens in incognito mode and automatically logs the user in, entering in their username and password:
It then gets past the prompt to remain logged in or not.
Next, we’re taken to the Apps page, and the Sales app is automatically selected:
Now we’re here:
The automation then takes us to Accounts:
And clicks the New button:
Then enters a random account name string:
On exiting the test, we get a green pass:
The tool is useful to build out your own tests and ensure when you build customizations, you are not breaking your existing functionality.
You can read more about the coverage and what is supported on the GitHub page.