Overview
Performance testing is an important aspect of application development and quality assurance. It helps us measure the performance and scalability of our applications under different workloads and scenarios. In a previous blog post What is the Best Tool for Dynamics 365 Performance Testing? - Microsoft Dynamics Blog I discussed how identifying and using the right tool is important for performance testing.
As we move away from the Performance SDK (PerfSDK) an alternative tool suggestion is Apache JMeter.
Getting started with JMeter
Apache JMeter
Apache JMeter is one of the tools that is available for measuring a website’s performance. Make sure you have the latest version of JMeter and any necessary plugins or dependencies installed and setup on your environment. You can check the latest release notes here.
Development environment
Dynamics 365 finance and operations apps development environment is required when using PerfSDK but it is not necessary when using JMeter. Development and testing can be executed on any machine that has a compliant Java installation which can run JMeter and any associated dependencies required for the performance testing.
Java Development Kit
JMeter is a Java-based tool that is written in Java and requires the Java Development Kit (JDK) to be installed on the system where it is being used. JMeter uses Java libraries to execute its functions and provides a GUI interface for users to create and run test plans for Dynamics 365 finance and operations apps.
Plugin
JMeter plugins are software extensions used in JMeter to extend features and insert functions. bzm – Correlation Recorder is one of the suggested plugins for performance testing Dynamics 365 finance and operations apps.
Configuration
There are a couple of configurations required before you start recording:
- JMeter CA certificate for HTTPS recording, the certificate needs to be renewed after 7 days.
- Configure Proxy for network traffic capture. Alternatively consider configuring your browser to use JMeter as a proxy for better results.
General differences: PerfSDK vs JMeter
To understand how to use JMeter for performance testing in Dynamics 365 finance and operations apps, it is important to compare PerfSDK and JMeter as there are several differences between them.
Performance SDK |
JMeter |
Developed and supported by Microsoft but Visual Studio 2019 is the last version of Visual Studio that includes web performance and load testing features and these will be deprecated in the future. |
Supported by a large community. It offers cross-platform compatibility and portability. |
Single-user and multi-user testing supported, but required Visual Studio Enterprise edition for multi-user testing. |
Open Source, single-user and multi-user testing supported. |
.Net framework. |
Java application. |
Steps captured by using Task recorder inside of Dynamics 365 finance and operations apps, and converted to C# script by Dynamics 365 add-in tool in development environment. |
Recording of the steps and scripts execution done by natively by JMeter. |
Script files can only run on the finance and operations apps development machine. |
Script files can be executed on any machine with the necessary Java prerequisites installed. |
Test users created in Dynamics 365 finance and operations apps. |
Microsoft Azure Active Directory (Azure AD) user setup is required and with assigned security role in Dynamics 365 finance and operations apps. |
Correlation Recorder plugin
Correlation plugin helps to record the dynamic variables and automatically correlates them during the task recording, instead of having to manually apply correlations to each request and response. Dynamics 365 finance and operations apps scenario uses this plugin to write correlation rules for login requests, activities in application and autocorrelated during task recording, such as:
- The session identifier
- CTX
- Hpgrequestid
- flowToken
- The CSRF security token
When using the JMeter Correlation Recorder plugin, the correlation rules are important as these rules facilitate the detection of dynamic variables in responses and their usage in subsequent requests. The correlation rules simplify this process, making it easy to identify and extract the relevant information. Correlation of these values is crucial to avoid errors and ensure accurate results.
Process JMeter with Dynamics 365 finance and operations apps
Task recording
There are significant differences between PerfSDK and JMeter when it comes to task recording. In PerfSDK, you always start recordings at the dashboard. However, in JMeter, you are required to start recording step by step from the login page. JMeter will capture all network traffic between client and server so more transactions are captured in the recording and require housekeeping. Despite this difference, there are no significant technical differences between the two tools. There are still a few recommendations from PerfSDK which are valid in relation to JMeter.
- Run a complete end-to-end scenario before capturing it.
- During the recording of the process, manually enter values instead of relying on drop-down lists for selection.
- Verify that everything functions as expected by replaying the recorded task. After completing the recording, review and validate the recorded steps in JMeter. Ensure that all the required actions and interactions are accurately captured.
- Performance test in a sandbox environment only, DO NOT perform performance testing in a production environment.
When the task is recorded, enhanced and completed post-configuration, you should have a test plan similar to that shown below in JMeter, you can test it with a single-user test and multi-user tests through the GUI (Graphical User Interface) to ensure the test script is work as expected.
Multi-user testing with JMeter
When conducting multi-user testing with JMeter, it is advisable to avoid running it in GUI mode due to its high resource consumption, which can adversely affect test performance and scalability. Instead, it is recommended to run JMeter in non-GUI mode for multi-user testing. Additionally, you can set up and expand test agents similar to Visual Studio and automate testing using load tools or Azure Load Testing.
Testing result
Below are some examples after executing multi-user testing to create purchase orders. In my case, I have 3 test accounts configured in the system and within the Data Set Config element. JMeter will randomly select the username and password combination from the file for each iteration of the test. This allows for randomized testing scenarios using different user credentials.
In my scenario, the created purchase orders will be submitted to the workflow by the script, and I will have another test script to approve the submitted workflows. I will provide more information in subsequent post.
Reporting results
Once the multi-user testing is completed, JMeter can generate reports from the test results file for analysis, available information includes:
- Number of iterations completed.
- Pass/fail rate.
- Response time.
- Latency during the testing.
You can verify the results within the report combined with telemetry from Dynamics 365.
Azure Load Testing
Azure Load Testing provides a scalable and flexible platform for load testing Dynamics 365 finance and operations apps. It is easy to scale out the workloads by configuration and apply tests to different environments.
Migration
Unfortunately, there are currently no migration paths available to convert PerfSDK testing scripts to JMeter. If you are considering using PerfSDK for performance testing in your current implementation project, it is recommended you compare JMeter as a performance testing tool, along with PerfSDK and other performance testing tools available in the market. Each implementation is different and therefore it is important to select the right tool for the immediate implementation and for future updates and performance testing requirements.
Summary
In this post, you gained an understanding of how to use JMeter for performance testing Dynamics 365 finance and operations apps. I am developing a blog series that will guide you through implementing single-user and multi-user performance tests with JMeter for Dynamics 365 finance and operations apps. The upcoming blog series will cover topics such as installing JMeter, creating a basic load test plan, executing the test, and analyzing the results. By the end of this series, you will be well-equipped to conduct performance testing in Dynamics 365 finance and operations apps using JMeter.
Blog series included: