简体   繁体   中英

How can I login multiple username and paasword using csv data set config in jmeter3.0?

In http request, I have set the variable names are

username=$(name)          
password=$(psw)

In CSV data set config set the details are:

File name: /home/desktop/login.txt            
Variable name: name,psw             
Delimiter use: ,  

In CSV file, I have three user accounts are:

radha,radha            
sumithra,sumithra        
moorthi,moorthi

In the above configuration, I have run the jmeter3.0 in Linux . But, It does not read the CSV/txt file data. the below invalid request passing my application.

POST data:

username=%24%28name%29&password=%24%28psw%29&userstate=others&submit=Enter

Kindly give me a useful solution.

Every step you have followed seems okay here. But as I can see you have missed declaring the variable properly in your scripts. In your Http request sampler, you have to send parameter as like below:

username=${name}
password=${psw}

In Http sampler:

在此处输入图片说明

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.

So in your case, POST data is shown as "username=%24%28name%29" because of the ( and ) .

For Reference, See HTML URL Encoding Reference .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM