Jmeter string functions through user defined variable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jmeter string functions through user defined variable

Deepak  Kumar
Hi All,

I am putting some jmeter string functions in a user defined variable like below :-

testdata = ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Play${__changeCase(Deepak\, change case,UPPER,)}

But when I am passing this value in request Body Data as ${testdata}, jmeter string functions are not resolving and I see below request in view result tree listener Request Body tab:

${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Kumar${__changeCase(Deepak\, change case,UPPER,)}

However, when I pass above same data directly in request Body Data instead of ${testdata}, it works perfectly fine as per view result tree listener request body data:-

¥¥My
Deepak
PlayDEEPAK, CHANGE CASE

I am using Jmeter 5.3 on Windows 10 with OpenJDK 14.0.1. Kindly help me anyone at earliest. One of my colleague is not facing the same issue.

Thanks & Regards,
Deepak
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you


Reply | Threaded
Open this post in threaded view
|

Re: Jmeter string functions through user defined variable

Felix Schumacher
Hi Deepak,

I have tried a simple test plan with your testdata and it is working as
expected.

I tested on Ubuntu 20.04 with OpenJDK 1.8.0 and 14.

Can you trie the attached test plan and see if it works on your setup, too?

Felix

Am 21.10.20 um 09:57 schrieb Deepak Kumar:

> Hi All,
>
> I am putting some jmeter string functions in a user defined variable like below :-
>
> testdata = ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Play${__changeCase(Deepak\, change case,UPPER,)}
>
> But when I am passing this value in request Body Data as ${testdata}, jmeter string functions are not resolving and I see below request in view result tree listener Request Body tab:
>
> ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Kumar${__changeCase(Deepak\, change case,UPPER,)}
>
> However, when I pass above same data directly in request Body Data instead of ${testdata}, it works perfectly fine as per view result tree listener request body data:-
>
> ¥¥My
> Deepak
> PlayDEEPAK, CHANGE CASE
>
> I am using Jmeter 5.3 on Windows 10 with OpenJDK 14.0.1. Kindly help me anyone at earliest. One of my colleague is not facing the same issue.
>
> Thanks & Regards,
> Deepak
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

deepak-udv.jmx (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter string functions through user defined variable

Deepak  Kumar
Thanks Felix for the reply.

Your jmx file worked. But similar UDV is not working in my project JMX. Actually I am working on SIP and passing SDP data through UDV where multiple time ${__unescape(\r\n)} string functions is being used for CRLF as SDP data is big but same is not evaluating there. Though, my colleague has similar setup and same is working at his end.

Regards,
Deepak

________________________________
From: Felix Schumacher <[hidden email]>
Sent: 21 October 2020 13:51
To: [hidden email] <[hidden email]>
Subject: Re: Jmeter string functions through user defined variable

"External email. Open with Caution"

Hi Deepak,

I have tried a simple test plan with your testdata and it is working as
expected.

I tested on Ubuntu 20.04 with OpenJDK 1.8.0 and 14.

Can you trie the attached test plan and see if it works on your setup, too?

Felix

Am 21.10.20 um 09:57 schrieb Deepak Kumar:

> Hi All,
>
> I am putting some jmeter string functions in a user defined variable like below :-
>
> testdata = ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Play${__changeCase(Deepak\, change case,UPPER,)}
>
> But when I am passing this value in request Body Data as ${testdata}, jmeter string functions are not resolving and I see below request in view result tree listener Request Body tab:
>
> ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Kumar${__changeCase(Deepak\, change case,UPPER,)}
>
> However, when I pass above same data directly in request Body Data instead of ${testdata}, it works perfectly fine as per view result tree listener request body data:-
>
> ¥¥My
> Deepak
> PlayDEEPAK, CHANGE CASE
>
> I am using Jmeter 5.3 on Windows 10 with OpenJDK 14.0.1. Kindly help me anyone at earliest. One of my colleague is not facing the same issue.
>
> Thanks & Regards,
> Deepak
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter string functions through user defined variable

Felix Schumacher

Am 21.10.20 um 10:43 schrieb Deepak Kumar:
> Thanks Felix for the reply.
>
> Your jmx file worked. But similar UDV is not working in my project JMX. Actually I am working on SIP and passing SDP data through UDV where multiple time ${__unescape(\r\n)} string functions is being used for CRLF as SDP data is big but same is not evaluating there. Though, my colleague has similar setup and same is working at his end.

If a more complex setup is failing, chances are, that there are other
problematic parts contained in your variable.

Try a more simple setup and work your way up to the complex setup until
it fails. Do this in small steps and report the first failing test.

Have a look at the log file jmeter.log. Are there any exceptions/errors?

Felix

>
> Regards,
> Deepak
>
> ________________________________
> From: Felix Schumacher <[hidden email]>
> Sent: 21 October 2020 13:51
> To: [hidden email] <[hidden email]>
> Subject: Re: Jmeter string functions through user defined variable
>
> "External email. Open with Caution"
>
> Hi Deepak,
>
> I have tried a simple test plan with your testdata and it is working as
> expected.
>
> I tested on Ubuntu 20.04 with OpenJDK 1.8.0 and 14.
>
> Can you trie the attached test plan and see if it works on your setup, too?
>
> Felix
>
> Am 21.10.20 um 09:57 schrieb Deepak Kumar:
>> Hi All,
>>
>> I am putting some jmeter string functions in a user defined variable like below :-
>>
>> testdata = ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Play${__changeCase(Deepak\, change case,UPPER,)}
>>
>> But when I am passing this value in request Body Data as ${testdata}, jmeter string functions are not resolving and I see below request in view result tree listener Request Body tab:
>>
>> ${__char(165)}${__char(165)}My${__unescape(\r\n)}Deepak${__unescape(\r\n)}Kumar${__changeCase(Deepak\, change case,UPPER,)}
>>
>> However, when I pass above same data directly in request Body Data instead of ${testdata}, it works perfectly fine as per view result tree listener request body data:-
>>
>> ¥¥My
>> Deepak
>> PlayDEEPAK, CHANGE CASE
>>
>> I am using Jmeter 5.3 on Windows 10 with OpenJDK 14.0.1. Kindly help me anyone at earliest. One of my colleague is not facing the same issue.
>>
>> Thanks & Regards,
>> Deepak
>> =====-----=====-----=====
>> Notice: The information contained in this e-mail
>> message and/or attachments to it may contain
>> confidential or privileged information. If you are
>> not the intended recipient, any dissemination, use,
>> review, distribution, printing or copying of the
>> information contained in this e-mail message
>> and/or attachments to it are strictly prohibited. If
>> you have received this communication in error,
>> please notify us by reply e-mail or telephone and
>> immediately and permanently delete the message
>> and any attachments. Thank you
>>
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]