0% found this document useful (0 votes)
8 views

How To Use Handler Functions To Interact With UI in Microsoft Dynamics NAV 2016

Uploaded by

difofo9927
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

How To Use Handler Functions To Interact With UI in Microsoft Dynamics NAV 2016

Uploaded by

difofo9927
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Contents

Introduction 3

Audience 3

Technology 3

Demo preset configuration 3

Demo instructions 3

Demo data preparation 4

Scenarios 4
Demo 1 – use TestPage to test UI 4

Demo 1 — use TestPage to test UI 5

Conclusion 11

Disclaimer 11

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
Introduction
We have reintroduced a feature called Test Automation Suite, which can be used by partners for testing solutions
and implementations of customized products. Enhancement involves fixing repeatability that was missing in the
previous edition. It improves the partner’s efficiency by significant savings on manual testing. The Test
Automation Suite builds on top of the testability features which add test capabilities to the development
environment, the C/AL language, and the runtime platform.

Audience
The demonstrations in this document are intended for partner resources such as developers, and testers. It is intended
for everyone interested in shipping stable repeatable solutions.

Technology
Microsoft Dynamics NAV 2016

Demo preset configuration


To test the functionality in this demo scripts, we advise you to deploy a Virtual Machine with the latest version of
Microsoft Dynamics NAV from the Microsoft Azure Gallery. Deploying a virtual machine from the Azure gallery
can be done in few minutes.
To explore how to do so we advise you to review this video or pdf.

The majority of the demonstrations are completed in the security role of “System administrator.”

Demo instructions
The demonstration scenarios in this demo script do not require demo data preparation. Also, the scenarios are
dependent on each other. The demonstrations scenarios build on each other.
To speed up the entering of C/AL code use attached object in TXT format.

Demo data preparation


N/A

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
Scenarios
Demo 1 – use TestPage to test UI
Viktor, the developer wants to enable the user to modify records through Bin Contents page (part of warehouse
management area).

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
Demo 1 — use TestPage to test UI
Demo story: The developer creates a test for the business logic that is implemented in the page.

What to do What to say Screenshots

1. In Development Although we
Environment open strongly
Object Designer by recommend not to
selecting Tools, Object use tests based on
Designer. UI, sometimes
2. Click Codeunits. there is no other
3. Click New. way to be sure that
4. Open Properties your modification
window by selecting works properly.
View, Properties.
5. Set the properties: An example where
ID = 50001 UI tests are
Name =SCM Whse. Bin required, is the
Content Small Business
SubType = Test functionality. This
6. Close Properties functionality is
window. based on standard
tables but it has a
rich logic
implemented on
the page layer.
Let’s create a new
test codeunit.

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
What to do What to say Screenshots

7. Click View, Globals In the current


8. In the Variable tab add demo, we
variables: encourage you to
 LibraryWarehouse: use standard
Codeunit Library - libraries to create
Warehouse test data. The
 LibraryInventory: libraries usually
Codeunit Library - significantly speed
Inventory up the process of
 LibraryUtility: test development.
Codeunit Library - Define the
Utility following global
 Assert: Codeunit variables - libraries
Assert and text constant.
9. In the Text Constants
tab add text constant
ErrDefBinContentFalse
with ConstValue Field
%1 of %2 table contains
unexpected value
(False).

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
What to do What to say Screenshots

10. In the Function tab On the Function


create and new test tab create a new
function function. Notice
ModifyBinContentThroug that by default this
hPage function has value
11. Add local variables: Test in Function
Location: Record Type property.
Location Add following local
Bin: Record Bin
variables, pay
BinContent: Record Bin
Content attention on
Item: Record Item variable of type
BinContents: TestPage TestPage
Bin Contents

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
What to do What to say Screenshots

12. Add following C/AL code To help you design


(use attached file) the relevant tests
13. Click Save in menu File, for your
click OK to confirm. functionality, you
can write scenarios
that outline what
you want to test,
and you can write
test criteria in the
GIVEN-WHEN-THEN
format. By adding
comments based
on feature,
scenario, and
GIVEN-WHEN-
THEN, you add
structure to your
test code and
make tests
readable.

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
What to do What to say Screenshots

14. Run windows client Now add a new test


15. In the Search box, enter to the test tool and
Test Tool, and then execute it.
choose the related link. When the run is
16. In the Test Tool, select completed, it will
Get Test Codeunits show the results in
and then select Select the Test Tool
Test Codeunits. page.
17. Click OK in the CAL Test Notice that the test
Get Codeunits, select ModifyBinContentT
test codeunits 50001. hroughPage should
18. Click OK fail with the
19. In the Test Tool, select message “You
Run and then select All. must first set up
20. Click OK user DOMAIN\USER
as a warehouse
employee.”.

21. Return to Development For most


Environment. warehouse
22. Add local variables to activities, the
function system requires a
ModifyBinContentThroug warehouse
hPage employee. Let’s
23. Add C/AL statement into adjust our test.
the end of GIVEN section. Notice that the
demo database
usually does not
contain users.
The Standard tests
calls the library
function which
registers the
current user as
warehouse

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
What to do What to say Screenshots

employee.
Note: the table
7301 Warehouse
Employee has a
table relation to
table User, but the
property
ValidateTableRel
ation is set to
False. This means
that you can create
a warehouse
employee even if
you have no users
in database.
24. In windows client Once completed,
25. In the Test Tool, select notice that the test
Run and then select All. passed successfully
26. Click OK now.

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016
Demo script
Conclusion Disclaimer
This set of demonstrations has presented the Test Automation Suite, which can be used by © 2015 Microsoft Corporation. All rights reserved. Microsoft,
partners for testing solutions and implementations of customized products. Test Windows, Windows Vista, Microsoft Dynamics and other product
Automation Suite functionality provides the following benefits: names are or may be registered trademarks and/or trademarks in
• Comprehensive test coverage of the Microsoft-provided application. the U.S. and/or other countries. Other names and brands may be
• No need to retest all functionality manually. Focus on new features only. claimed as the property of others.
• Identify regression before moving to production.
• Reduces the rump up costs with libraries and samples. The information herein is for informational purposes only and
• Foundation for TDD methodology. represents the current view of Microsoft Corporation as of the date
of this presentation. Because Microsoft must respond to changing
market conditions, it should not be interpreted to be a com-
mitment on the part of Microsoft, and Microsoft cannot guarantee
the accuracy of any information provided after the date of this
presentation. Microsoft may make changes to specifications and
product descriptions at any time, without notice.

This content is provided “as-is”. Information and views expressed


in this content, including URL and other Internet Web site
references, may change without notice. Some examples depicted
herein are provided for illustration only and are fictitious. No real
association or connection is intended or should be inferred.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR


STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. NO
LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO
ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS
PRESENTATION. Microsoft products are not intended for use in
medical, lifesaving, or life sustaining applications.

Microsoft Dynamics is a line of integrated, adaptable business


management solutions that enables you and your people to make
business decisions with greater confidence. Microsoft Dynamics
works like and with familiar Microsoft software, automating and
streamlining financial, customer relationship and supply chain
processes in a way that helps you drive business success.

U.S. and Canada Toll Free 1-888-477-7989

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script
Worldwide +1-701-281-6500
www.microsoft.com/dynamics

HOW TO use TestPage to test UI in Microsoft Dynamics NAV 2016


Demo script

You might also like