Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Blogs / OlisterR's NAV/BC blog / Test Toolkit in Business Ce...

Test Toolkit in Business Central(SaaS) - How to setup and execute Custom Test Cases

Introduction:
Test Automation is basically writing code to test and verify whether the application functionality developed works as expected. When you install NAV / Business Central - OnPremise, the installation folder consists of standard Test Toolkit Objects which are to be imported manually if you want to enable Test Automation in your project. But, for Business Central (SaaS) it comes pre-installed.  Let us see how Test Automation is done in Business Central(SaaS) with the help of Test Toolkit and how to set up your own test cases for the customization you've developed for the system.

Books & Reference:
1. Automated Testing in Microsoft Dynamics 365 Business Central (https://tinyurl.com/y3zpy27p)
Pre-requisites:
Microsoft Dynamics Business Central (SaaS)
VS Code(https://code.visualstudio.com/download)
AL Language Extension(https://tinyurl.com/yyvzxwkb)

Demonstration:
1. Checking the installed Test Toolkit in Business Central(SaaS):
When searching for Test Tool in Business Central(SaaS) global search, I didn't find any results.

I checked the Permission Set and its permissions for the User.

Checking the Permissions for the SUPER Permission Set


This only means that either the Object for Test Toolkits are not present or their not accessible directly.
Let us try calling through URL. Append &page=130401 in the URL

Nice!! . Which means that Test Toolkit is not directly accessible through global search.

2. Setting Up Test Toolkit in VS Code:
In the existing app or a new app, you can add a test version parameter in 'app.json' file and download the symbol to get the object reference symbols for Test Toolkit.

3. Creating your own custom Test Toolkit App:
In this, you create your own codeunit to test the cases
SubType = Test which means that this codeunit is to be involved in Test Toolkit. Refer(https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-subtype-codeunit-property)
To get the procedure into Test Toolkit,you have to type [Test] before the procedure just like Event Subscribers


Getting the procedure into the Test Tool


Finally running the function and getting results


Conclusion:
This is how you can do Test Automation in Business Central. In the upcoming blogs, I will try to get into more details.
Happy Weekend :) Cheers!

Comments

*This post is locked for comments