Custom JMeter Functions not working with JMeter 5.1.1 and breaks standard JMeter functions

55 views
Skip to first unread message

Prit

unread,
Apr 11, 2019, 6:49:04 AM4/11/19
to jmeter-plugins
I needed to encode a string to Base64 so I installed Custom JMeter Functions 2.1 using Plugins Manager on JMeter 5.1.1.

Not only did the custom functions not work, but it also broke the JMeter standard functions. I tried downgrading the plugin to 2.0 but that did not resolve it. I tried downgrading to JMeter 4.0 but had the same problem. 

My input is always the same (posting a HTTP request), the only thing I changed was having the plugin installed or not.


My input:

{
    "user_input": null,
    "variables": {
        "${__V(Language${__Random(1,3,)})}",
        "${__V(Gender${__Random(1,3,)})}",
        "${__time(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',)}",
        "${__timeShift(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',${__time()},-PT1H,,)}",
        "${__RandomString(29,abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ123456789)}",
        "${__RandomString(15,1234567890)}",
        "${__base64Encode(hello)"
 
        }
}



Without the plugin installed, the request that is posted is as expected:

POST data:
{
    "user_input": null,
    "variables": {
        "FR",
        "Female",
        "2019-04-11T11:25:04.676Z",
        "2019-04-11T10:25:04.676Z",
        "xAUderFKgvlFY28kwcw6DU33xeRDy",
        "663915594818506",
        "${__base64Encode(hello)"
         }
}



With the plugin installed, the request that is posted is:

POST data:
{
    "user_input": null,
    "variables": {
        "${__V(Language${__Random(1,3,)})}",
        "${__V(Gender${__Random(1,3,)})}",
        "${__time(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',)}",
        "${__timeShift(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',${__time()},-PT1H,,)}",
        "${__RandomString(29,abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ123456789)}",
        "${__RandomString(15,1234567890)}",
        "${__base64Encode(hello)"
         }
}



So none of the functions are working. If I remove the plugin, it starts to behave again. Is it a bug or am I doing something wrong?


Thanks in advance

Mohamed Ibrahim

unread,
Apr 11, 2019, 6:53:12 AM4/11/19
to jmeter-...@googlegroups.com
Hello,
You left out a closing curly braces at the post body in base encode param.

"${__base64Encode(hello)" 


It should be "${__base64Encode(hello)}" 


Thanks,
Mohamed Ibrahim

Confidentiality: This e-mail (and any associated files) is intended only for the use of the intended recipient and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any disclosure, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and then delete it from your computer. Messages sent to and from us may be monitored. The views expressed in this message are those of the author and do not necessarily represent the views of Esendex Ltd.

Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communications medium. We recommend you observe this when e-mailing us.

Esendex Ltd is a limited company registered in the UK, with company number 04217280 and having its registered office at 20 Wollaton Street • The Atrium • Nottingham • NG1 5FW 

This e-mail (and any associated files) is intended only for the use of the intended recipient and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any disclosure, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and then delete it from your computer. Messages sent to and from us may be monitored. The views expressed in this message are those of the author and do not necessarily represent the views of Commify UK Limited trading as Esendex.

Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communications medium. We recommend you observe this when e-mailing us.

Commify UK Limited trading as Esendex is a limited company registered in the UK, with company number 04217280 and having its registered office at 20 Wollaton Street • The Atrium • Nottingham • NG1 5FW •

--
You received this message because you are subscribed to the Google Groups "jmeter-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Thanks,
Mohamed Ibrahim

Prit

unread,
Apr 11, 2019, 6:56:07 AM4/11/19
to jmeter-plugins
D'oh! Well spotted! Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages