Testing Microsoft Dynamics 365 Applications

Applies to TestComplete 15.47, last modified on January 20, 2023

Microsoft Dynamics 365 is a CRM and ERP solution by Microsoft that combines a set of SaaS applications targeted to various aspects of the business. These applications are web-based and are usually accessed by using a web browser.

With TestComplete, you can create automated tests for web pages and web applications, including Microsoft Dynamics 365 applications. It recognizes individual web elements on web pages, and you can record (or create from scratch) and then run automated tests that interact with these elements and simulate user actions over them. For example, you can create an automated test that accesses the Microsoft Dynamics 365 Sales application in a web browser and adds a new contact or a new lead.

Requirements

  • An active license for the TestComplete Web module.

  • The Web Testing plugin must be enabled in TestComplete (it is installed and enabled by default).

  • One of the following browsers must be installed on your TestComplete workstation and be prepared for testing:

    • Microsoft Edge 83 - 103 (based on the Chromium engine, both 32-bit and 64-bit versions)

      Note: The non-Chromium version of Edge is not supported.

    • Microsoft Internet Explorer 11 (both 32-bit and 64-bit versions)

      Note: The Modern UI (Metro) version of Internet Explorer 11 is not currently supported.

    • Google Chrome 103 (both 32- and 64-bit versions)

      If you use a later version of Google Chrome, check whether a patch is available for it.

    • Mozilla Firefox 91 - 102.1 ESR, 94 - 102 (both 32-bit and 64-bit versions)

      If you use a later version of Firefox, check whether a patch is available for it.

    To learn how to prepare web browsers for testing, see Preparing Web Browsers.

  • If you are planning to run tests in remote environments, also see the requirements for cross-platform web tests.

Creating and recording tests for Microsoft Dynamics 365 apps

To create a test, you can record user actions over the Microsoft Dynamics 365 applications in one of the supported web browsers, or you can create a test from scratch. The easiest way to create a test is to record it:

  1. In TestComplete, start recording.

  2. Launch your web browser.

  3. Sign in to Microsoft 365, start the Dynamics 365 launcher, and then start the needed Dynamics 365 application.

  4. Interact with the application in your browser and an end user would: click links, input data into forms, and so on.

  5. Stop the recording.

TestComplete will process the performed actions and generate the test. The images below show an example of a recorded test that simulates user actions over the Microsoft Dynamics 365 Sales application:

A keyword test

Recorded keyword test that simulates user actions over the Sales app

Click the image to enlarge it.

A script test

Recorded script test that simulates user actions over the Sales app

Click the image to enlarge it.

The test consists of a sequence of operations that simulate user actions over the application.

Identifying, storing, and mapping objects of Microsoft Dynamics 365 applications

In TestComplete, for an automated test to be able to simulate user actions over Microsoft Dynamics 365 applications (or any other tested web application), it must locate the target object, over which the action is to be simulated, in a web browser.

By default, when you record a test, TestComplete automatically detects objects with which you are interacting and adds them to the Name Mapping repository of the TestComplete project. For each object, it assigns an alias and identification criteria.

Microsoft Dynamics 365 objects added to the Name Mapping repository

Click the image to enlarge it.

The alias is a short name used to refer the object in tests. The identification criteria are used to locate the object during the test run. To learn more about working with the Name Mapping repository, see Name Mapping.

Simulating user actions

To simulate user actions over the Microsoft Dynamics 365 applications, you can use methods and properties that TestComplete provides for the most common web elements, for example, Click, DblClick, SetText, Keys, and so on. You can find information on those elements and properties and methods that TestComplete provides in the following section:

List of Web Objects

The example below shows how to use the ClickItem method to simulate selecting an item from a drop-down list (combo box):

Simulating user actions in keyword tests

Click the image to enlarge it.

JavaScript, JScript

function Create_Contact()
{
  // Launch the Sales app
  var pageAppsDynamics365 = Aliases.browser.pageAppsDynamics365;

  pageAppsDynamics365.Wait();

  // Add a new contact
  pageAppsDynamics365.buttonNew.ClickButton();

  var contactInfo = pageAppsDynamics365.sectionContactInformation;

  // …
  contactInfo.selectContactMethod.ClickItem("Phone");
  // …

}

Python

def Create_Contact():
  # Launch the Sales app
  pageAppsDynamics365 = Aliases.browser.pageAppsDynamics365

  pageAppsDynamics365.Wait()

  # Add a new contact
  pageAppsDynamics365.buttonNew.ClickButton()

  contactInfo = pageAppsDynamics365.sectionContactInformation

  # …
  contactInfo.selectContactMethod.ClickItem("Phone")
  # …

VBScript

Sub Create_Contact()
  ' Launch the Sales app
  Set pageAppsDynamics365 = Aliases.browser.pageAppsDynamics365

  pageAppsDynamics365.Wait()

  ' Add a new contact
  pageAppsDynamics365.buttonNew.ClickButton()

  Set contactInfo = pageAppsDynamics365.sectionContactInformation

  ' …
  contactInfo.selectContactMethod.ClickItem("Phone")
  ' …

End Sub

DelphiScript

procedure Create_Contact()
var pageAppsDynamics365, contactInfo;
begin
  // Launch the Sales app
  pageAppsDynamics365 := Aliases.browser.pageAppsDynamics365;

  pageAppsDynamics365.Wait();

  // Add a new contact
  pageAppsDynamics365.buttonNew.ClickButton();

  contactInfo := pageAppsDynamics365.sectionContactInformation;

  // …
  contactInfo.selectContactMethod.ClickItem('Phone');
  // …

end;

C++Script, C#Script

function Create_Contact()
{
  // Launch the Sales app
  var pageAppsDynamics365 = Aliases["browser"]["pageAppsDynamics365"];

  pageAppsDynamics365.Wait();

  // Add a new contact
  pageAppsDynamics365["buttonNew"]["ClickButton"]();

  var contactInfo = pageAppsDynamics365["sectionContactInformation"];

  // …
  contactInfo["selectContactMethod"]["ClickItem"]("Phone");
  // …

}

Running tests

On local computers

You can run the recorded automated test on your local computer as is. The easiest way to run a test is to click Run:

Running a recorded keyword test on a local computer

TestComplete will run all recorded test operations. This way, it will repeat all user actions that were performed during the test recording.

To learn more about running automated tests and managing test runs, see Running Tests.

In remote environments

In TestComplete, you can connect to remote environments and run tests there. This way, you can check how your tested web application or web page functions in various web browsers and on various operating systems, including those that TestComplete does not support directly, for example, non-Windows operating systems. Organize test runs in remote environments by using the Execution Plan editor of your project:

Running tests in remote environments

Click the image to enlarge it.

To learn more about this, see About Cross-Platform Web Tests.

Viewing test results

After the test run is over, you can view the results in TestComplete. The results include the overall test status (pass, fail, pass with warnings) and detailed data on each simulated user actions:

Test log

Click the image to enlarge it.

See Also

Testing Microsoft Dynamics 365 Applications
Web and RIA Testing
About Cross-Platform Web Tests

Highlight search results