Bug 65116 - Custom JMeter Functions plugin is not detected if jmx file contains any of its functions
Summary: Custom JMeter Functions plugin is not detected if jmx file contains any of it...
Status: NEEDINFO
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: Nightly (Please specify date)
Hardware: PC All
: P2 normal (vote)
Target Milestone: JMETER 5.4.1
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-01 00:27 UTC by eR@SeR
Modified: 2022-05-09 22:52 UTC (History)
0 users



Attachments
customJMeterFunctions.jmx (5.28 KB, application/xml)
2021-02-01 00:27 UTC, eR@SeR
Details
pop up messages (181.51 KB, application/vnd.rar)
2021-02-06 23:46 UTC, eR@SeR
Details
A simple workaround (9.28 KB, application/xml)
2022-05-09 22:51 UTC, Mohamed Ibrahim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eR@SeR 2021-02-01 00:27:31 UTC
Created attachment 37722 [details]
customJMeterFunctions.jmx

Hello,

If jmx file contains any of the Custom JMeter Functions like "doubleSum", "if", "base64Encode" etc. but the plugin is not previously installed by JMeter plugins manager, an error pop up message is not shown like for other missing plugins. If JMeter plugins manager is put in lib/ext folder, and when jmx file is opened which contains one or more of its functions, it doesn't detect that plugin should be installed and therefore functions are not evaluated when test is run. Check jmx example in the attachment.

Expected:

Pop up error message is shown that Custom JMeter functions are detected in jmx file. If JMeter plugins manager is in lib/ext folder, suggest the installation of Custom JMeter functions.

Or

All Custom JMeter functions can be merged to be part of JMeter core functions. I vote for the latter.

Custom JMeter functions link https://jmeter-plugins.org/wiki/Functions/

Jmeter 5.5 ff9866a
Microsoft Windows 10 Enterprise 64-bit
java version "14.0.1" 2020-04-14
Comment 1 Felix Schumacher 2021-02-06 10:27:43 UTC
This issue addresses a two points simultaneously. 

a) It is about merging functionality from external plug-ins into JMeter
b) It is about the way JMeter handles non-existing functions

On a)

Plug-ins are invented to ease the burden on the core JMeter team. We are only a few people and are happy, that others can and do provide extensions via plug-ins. Inclusion of such functionality should be done after careful inspection (best via devs mailing list).

On b)

I think, that this can't be changed easily. The way JMeter currently works, is that it tries to find a function by the name inside the ${...} constructs. JMeter doesn't know or care, where the function was defined (plug-in or built-in). So, we can't tell a user function X should be provided by plug-in Y.

At the moment the best we could do, would be to display a warning, that a function was not found.

For such a warning, we would have to decide, where to display it - log message or display a dialog?

Maybe we could discuss better ways to hint at the source of messages on the mailing list (devs?).

I think it might be nice to have an option to include custom functions (as JSR-223 snippets?) inside test plans, but on a first glance, this doesn't look easy.
Comment 2 eR@SeR 2021-02-06 23:46:40 UTC
Created attachment 37729 [details]
pop up messages

Hi,

> a) It is about merging functionality from external plug-ins into JMeter
We can discuss it on dev list, as you suggested. Thorough testing should be done for sure.

> At the moment the best we could do, would be to display a warning, that a function was not found.
> For such a warning, we would have to decide, where to display it - log message or display a dialog?
As I said, for other plugins we have pop-up error message shown. So, yes both log message and dialog display should be done. Example images for the Dummy sampler are in the attachment. You can follow the same pattern as shown in the images.

> I think, that this can't be changed easily. The way JMeter currently works, is that it tries to find a function by the name inside the ${...} constructs. JMeter doesn't know or care, where the function was defined (plug-in or built-in). So, we can't tell a user function X should be provided by plug-in Y.
Yes, that's right. That is the job of jmeter-plugins-manager-1.6.jar file, I guess. IDK how it works, since it detects properly which jar file to download if the plugin is not installed. If pop-up error message is implemented, probably the change should be done on JMeter plugins side as well - to point to the corresponding jar file download. The most important thing here is that JMeter notifies user that functions, that are not part of the core are detected and that the loaded jmx file won't work as expected.
Comment 3 Mohamed Ibrahim 2022-05-09 22:51:43 UTC
Created attachment 38280 [details]
A simple workaround
Comment 4 Mohamed Ibrahim 2022-05-09 22:52:50 UTC
Needed info form the user
Comment 5 The ASF infrastructure team 2022-09-24 20:38:21 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5495