Bo's blog

Tuesday, March 11, 2014

JMeter:http request with while and csv config

User Defined Variables
add vailables
host localhost
newUserName 111

HTTP Request Defaults
Server name or IP : ${host}                 Port Number: 80
Path: /

    Thread Group
    Number of Threads = 10  
    Loop Count = 1
        . . .
        While Controller
        Condition = ${__javaScript("${newUserName}"!="",)}  // this will repeat until EOF

            CSV Data Set Config
            Filename = ${__property(user.dir)}${__BeanShell(File.separator,)}${__P(users-list,)}    // path to generated users-list
            Variable Names = newUserName,newUserPwd    // these are test-users details read from file into pointed variables
            Delimiter =,
            Recycle on EOF? = False
            Stop thread on EOF? = True
            Sharing Mode = Current thread

            HTTP Request
HTTP Request Method: POST
Body Data:

${newUserName}
${newUserPwd}


Aggregate Graph

View Results in Table
Filename = C:\work\tools\apache-jmeter-2.11\GICTest\Test Result

View Results Tree (will have request and result in the result list)


userlist.csv
========================
username1,password1
username2,password2

Labels:

0 Comments:

Post a Comment

<< Home