I'm trying Jmeter tool for load testing where i'm feeding the data through a csv file which has all the emails and passwords for login request. But while passing the parameter, Jmeter is encoding '@' sign with '%40' and if i put %40 in place of @ in my csv, its not getting decoded to @ in Jmeter. For other special characters, the encoding and decoding is happening properly. Please help.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It should be totally expected.
If you're logging in via GET request %40
is correct way of encoding @
symbol.
If you're sending a POST request, JMeter should automatically send @
symbol (at least my JMeter 2.10 does)
You might wish to try one of following:
- Add View Results Tree listener, switch to
HTTP
tab and see what's actually being sent. - Make sure that
Encode?
box is unchecked for email parameter - Explicitly tell JMeter to decode email via __urldecode() function
Use a Beanshell Pre Processor to properly encode/decode your email
import java.net.URLDecoder; import java.net.URLEncoder; String email = "someone@example.com"; String encoded = URLEncoder.encode(email, "UTF-8"); String decoded = URLDecoder.decode(encoded, "UTF-8");
回答2:
This is coming when we do via Parameters, If we do using "Body Data" that would work fine.
I used this way. {"password":"${password}","emailId":"${emailId}"}
回答3:
For the HTTP Request, Change the Client implementation to Java
- Select the Advanced tab from the HTTP Request
- In Client Implementation > Choose Java in Implementation