Using EasyRepro for Automated UI Testing in Dynamics 365 Power Apps

Leave a comment

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:

Click Restore:

Then Build:

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:

And Saves:

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.

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *