Automation insights and productivity tips from LEAPWORK.

All Posts

Guide: How to do Test Automation in Dynamics 365

Microsoft Dynamics 365 is a widely used suite of enterprise applications for practically any function within customer engagement, finance, and operations.

With frequent updates to the core and standard applications, Dynamics-users face a growing workload of continuously verifying thousands of business critical processes.

There are lots of reasons why it can pay off to automate tests that involve Dynamics 365, which you'll learn about in this guide. 

If you want to read this guide later or save it for reference, don't forget to download it below.

If you're curious to learn more, watch our Dynamics 365 webinar on demand to find out how you can automate your tests.

Download Guide Test Automation Dynamics 365

Why test Dynamics 365?

The various applications in Dynamics work together like building blocks. Different organizations choose different blocks, meaning Dynamics is rarely built in the same way. For example, the needs of an eCommerce business differs from the needs of a physical store, and thereby requires different components.

Modern businesses are constantly evolving and adapting to the changes in the market, and the out-of-the-box functionality of the Dynamics 365 applications is not always sufficient for these businesses. Here enters the developer who, hired by these companies, configures the building blocks to meet businesses’ specific needs. And, as those frequently change, this becomes an ongoing process.

It is common knowledge in the software testing world that whenever a developer changes a piece of code, it can affect existing functionality, causing new bugs to emerge. This is why Dynamic´s UI and functionality must be tested, not only when the initial structure of the building blocks has been made, but also each time they’re customized. 

LEAPWORK_RegressionTesting_Bugs-1When you fix one bug, but introduce several new ones.

What's more, frequent updates in the applications will lead to the same need for more testing to make sure everything works as it should. Microsoft releases new updates every six months and, sometimes, these updates can break the developer's customizations.

The result is a need for frequent testing due to the (re)structuring of the applications, their customization and external updates.

How much testing is required?

You can expect to be testing Dynamics a lot, which raises the following question: should it be done manually or automated?

Manual UI tests, for example, would be implemented by a team that sets up a list of expectations and requirements. Then they have to manually click through your Dynamics 365 set-up to see if each test passed or failed. This requires substantial resources and time, plus manual testing is exposed to human-error. 

When we automate testing in Dynamics 365, a computer runs these tests. The QA team can then spend their time doing exploratory testing.

Once we understand this, it's not difficult to see the obvious benefits of implementing automation in the testing process. It will speed up the process and reduce human-error while ensuring that business-critical processes are performing as expected.

However, awareness of the interplay between manual and automated testing is vital. It might be tempting to automate everything you possibly can, but that doesn’t mean you should.

Some tasks, typically more advanced, are less qualified for automation. And the benefit of automating repetitive and error-prone tasks is more time for testers to work on what they do best – manual exploratory testing.

What can be automated in Dynamics 365?

Here are a few examples of fundamental interactions that can be automated in order to test Dynamics 365:


Dynamics applications often rely on automatic login, where user credentials are transferred from a Microsoft 365 login to the Dynamics application. Testing the login process will allow you to verify features and updates as different users and roles.


Dynamics relies on correct data generation. You can create a test to automatically create new data in Dynamics, such as a new contact in the Sales application. Take into consideration that forms consist of different field types: plain text fields, drop-downs, look-up fields, date fields, and two-options fields.

Read Data

Dynamics is usually integrated with multiple products and applications. This means that maintaining the integrity of data can be a challenge, especially when entering data from multiple channels. For this reason, it is a good idea to create tests that automatically read and verify data from Dynamics.

Finding Items

You can build tests that automatically find items and data entries in the many lists and views in Dynamics. When using an automation tool, you might want to have the option of inputting values dynamically from spreadsheets, databases, web services, and other sources.

Data-Driven Automation

Data-driven automation is one of the most fundamental interactions you should automate in Dynamics. All the data we have in our Dynamics applications is drawn from external data sources, such as Excel. An example would be to draw information from a spreadsheet containing a list of contacts in order to create contacts in the Dynamics Sales application. Therefore, you should never forget to create tests that automatically fill in forms in Dynamics 365 using an external data source to create multiple data.

Testing using a no-code tool

If you’re already familiar with concepts such as “nested iFrames”, “deep object trees”, or “dynamic IDs for child windows” when automating simple processes, you know that Dynamics 365 products are somewhat complex web applications that are difficult to automate using scripts. And, if you are not familiar with those concepts, the scripting of test cases is arguably going to become even more difficult.

For example, just making the Selenium WebDriver (a popular testing tool) find the right element in the application requires the tester to spend a lot of time scripting the correct locator strategy.

Automating Dynamics 365 testing using a no-code approach will eliminate these struggles. For example, with LEAPWORK’s various functionalities, testers will not have to worry about programming languages, such as C# or Java, or even how Dynamics 365 is implemented from a technical point of view. Scripting is replaced with a visual drag-and-drop interface, allowing everyone in the team to participate and conduct tests, while simultaneously saving time.

Did you know? Gartner highlighted LEAPWORK as a preferred no-code test automation software for Dynamics 365. You can find more information in Gartner's Report: Implementing Microsoft Dynamics 365 Application Using Power Apps and DevOps.


How to test Dynamics 365 with a no-code tool

Currently, Dynamics 365 and Power Apps only have testing solutions that require heavy coding. This is not aligned with the no-code approach that drives the model-driven CRM application development efforts.

The LEAPWORK Automation Platform uses Selenium as an engine for automating websites and web applications, but all the Selenium-code for automating tests is generated ‘under the hood’. The tester does not, at any point, have to worry about reading or writing a single line of code. In fact, the tester doesn’t need to know anything about Selenium at all. 

According to Gartner, LEAPWORK "provides the capabilities to define, automate and maintain test cases for Dynamics 365 applications".

For example, with LEAPWORK’s Capture functionality, the tester can identify a form field in a Dynamics application, and use that object in

his or her test cases. This is done without having to worry about programming languages, such as C# or Java, or even how Dynamics 365 is technically implemented.

Dynamics flow LEAPWORK

Example of a LEAPWORK flow doing data-driven automation of Dynamics 365.

To make things easier and to increase the robustness of automated test cases we, at LEAPWORK, have added intelligent Dynamics-adapters on top of the Selenium engine. This means for example that you can use standard LEAPWORK components (we call them ‘building blocks’) to automate form fields of any kind in Dynamics applications.

Even drop-down fields are handled the same way, regardless of how they are technically implemented in Dynamics. We developed these adapters because we learned from testers that form fields, in particular, caused headaches when trying to automate Dynamics.

According to Gartner, LEAPWORK "provides the capabilities to define, automate and maintain test cases for Dynamics 365 applications".


LEAPWORK's Dynamics 365 Customer Engagement (CE) package contains sample flows so you can get started with Dynamics automation quickly and easily.

The package contains six sample flows that demonstrate how to automate Dynamics 365 CE. Some of the functionality is contained in reusable components, making it easy for you to build your own automation flows.

All sample flow elements come in a zip file that can be imported into your existing installation of LEAPWORK.

Sample flows:

  • Login Component
  • Setting values in a form
  • Reading data
  • Searching lists & reusability
  • Using external data sources

Curious to learn more about test automation and Dynamics 365? If you have any questions you'd like to get answered on this topic, we invite you to attend our webinar on this topic. Sign up below.

Watch webinar

Lucia Cavero-Baptista
Lucia Cavero-Baptista
Content Marketing Manager

Related Posts

Best Practices for Building Maintainable and Scalable Test Automation

There’s a major difference between automating twenty test cases and automating 2000 test cases; while it’s completely possible to take an ad-hoc approach when there are only a few test cases, it becomes an entirely different story when test cases run into the thousands.

How to Build Stable Test Automation

Test automation brings many benefits with it, such as increased execution and reduced risk. But these benefits may be diminished if the tests aren’t performing as intended. There are several reasons why tests become unstable, most of which you can turn around by following these best practices and guidelines.

How to Effectively Analyze Test Automation Results

If you have introduced test automation as a means to achieve more efficient testing, you’re probably also interested in making the test result analysis process as efficient as possible. This requires the right approach and the right set of tools.