在http请求中,我设置的变量名称是
username=$(name)
password=$(psw)
在 CSV 数据集配置集中,详细信息为:
File name: /home/desktop/login.txt
Variable name: name,psw
Delimiter use: ,
在 CSV 文件中,我有三个用户帐户:
radha,radha
sumithra,sumithra
moorthi,moorthi
在上面的配置中,我在Linux中运行了jmeter3.0
。但是,它不会读取 CSV/txt 文件
数据。以下无效请求通过了我的申请。
POST 数据:
username=%24%28name%29&password=%24%28psw%29&userstate=others&submit=Enter
请给我一个有用的解决方案。
最佳答案
您所遵循的每一步在这里似乎都没有问题。但正如我所看到的,您错过了在脚本中正确声明变量的情况。在您的 Http 请求采样器中,您必须发送如下参数:
username=${name}
password=${psw}
在 Http 采样器中:
Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
因此,在您的情况下,由于 (
和 )
,POST 数据显示为 "username=%24%28name%29" .
有关引用,请参阅 HTML URL Encoding Reference .
关于java - 如何在jmeter3.0中使用csv数据集配置登录多个用户名和paasword?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39306282/