- Automated Testing in Microsoft Dynamics 365 Business Central
- Luc van Vugt
- 575字
- 2021-06-24 14:56:52
Standard tests
Goal: Get to know the basics of the standard tests provided by Microsoft.
Ever since NAV 2016, Microsoft made their own application test collateral a part of the product. A humongous set of tests is delivered as a .fob file on the product DVD, in the TestToolKit folder, and in the Docker images. Indeed, the tests haven't been delivered as an extension yet.
The standard test suite does contain mainly test codeunits. But there are also a number of supporting table, page, report, and XMLport objects in the .fob file.
For Dynamics 365 Business Central, the whole set contains almost 23,000 tests in more than 700 test codeunits, for w1 and local functionality for each country in which Microsoft releases. And with every bug that's fixed and with every new feature introduced in the application, the number of tests is growing. It has been built over the last ten years and it covers all functional areas of Business Central.
Let's set up a new suite in the Test Tool called ALL W1:
- Click on the Assist Edit button in the Suite Name control
- In the CAL Test Suites pop-up window select New
- Populate the Name and Description fields
- Click OK
To open the newly created test suite:

Now, using the Get Test Codeunits action, let Business Central fetch all standard test codeunits as shown in the next screenshot. Note that I did remove our test codeunit 60000 through 60003:

Reading the names of all test codeunits will give you a first impression of what they entail, which are as follows:
- Enterprise Resource Management (ERM) and Supply Chain Management (SCM) codeunits:
- These two categories contain almost 450 codeunits to form the major part of standard test collateral
- ERM test codeunits cover G/L, sales, purchase, and inventory
- SCM test codeunits cover warehouse and production
- Apart from ERM and SCM, several other categories can be noted, of which the biggest are:
- Service (approximately 50 test codeunits)
- O365 integration (approximately 35)
- Job (approximately 25)
- Marketing (approximately 15)
Most of these test codeunits contain functional, end-to-end tests. But there are also codeunits that hold unit tests (UT). These are marked by the addition of Unit Test to their name. Some examples are as follows:
- Codeunit 134155 - ERM Table Fields UT
- Codeunit 134164 - Company Init UT II
- Codeunit 134825 - UT Customer Table
With headless testing being the initial trigger for bringing the testability framework into the platform, it's no surprise that the clear majority of standard test codeunits comprises headless tests. Test codeunits that are meant to test the user interface (UI) are marked using UI or UX in their name. Some examples are as follows:
- Codeunit 134280 - Simple Data Exchange UI UT
- Codeunit 134339 - UI Workflow Factboxes
- Codeunit 134711 - Autom. Payment Registration.UX
- Codeunit 134927 - ERM Budget UI
Note that these are not the only test codeunits addressing the UI. Any other might contain one or more UI tests, where, in general, the bulk will be headless tests.
As I am often asked how to test reports, it is noteworthy to mention as a last category those test codeunits that are dedicated to testing reports. Search for any test codeunit that is marked with the word Report in its name. You will find 50+ of them. The following are a couple of examples:
- Codeunit 134063 - ERM Intrastat Reports
- Codeunit 136311 - Job Reports II
- Codeunit 137351 - SCM Inventory Reports – IV
- 大公司的成功做法 小公司的制勝干法
- 企業(yè)內(nèi)部控制與風(fēng)險(xiǎn)管理實(shí)戰(zhàn)
- 刻意誠(chéng)信:以最低成本達(dá)成目標(biāo)
- 醫(yī)院人力資源管理
- 債轉(zhuǎn)股的公司治理效應(yīng)研究
- 股權(quán)設(shè)計(jì)與股權(quán)激勵(lì):管理工具與案例分析
- 數(shù)字政府架構(gòu)設(shè)計(jì)參考
- 王傳福管理日志
- 產(chǎn)品三觀
- 不枯燥的B端產(chǎn)品實(shí)戰(zhàn)課
- 文化基因的品牌鐫刻:夢(mèng)祥品牌文化
- 關(guān)鍵在人:人才經(jīng)營(yíng)的16個(gè)關(guān)鍵點(diǎn)
- 塑造奮斗者:松下幸之助積極性管理的精髓
- 公共式托管:自主管理班組創(chuàng)建(名家教你辦企業(yè))
- 創(chuàng)業(yè)者手冊(cè)(典藏版)