mysql - How to split and execute JDBC insert sql queries per each splitted values in JMeter -
i have requirement of reading .csv file , and split 1 particular parameter value , execute database calls each spitted strings. example have entries in .csv file follows.
{user}, {email}, {keys} ,{age} --------------------------------- user1, user1@ws.com, user1-key1:user1-key2:user1-key3, 28 user2, user2@ws.com, user2-key1, 29 user3, user3@ws.com, user3-key1:user3-key2:user3-key3:user4-key4, 50
my requirement here split value comes {key} parameter @ delimiter of ':' , execute database inserts per each key value. need following database inserts after executing jmeter script.
username | email | key | age ------------------------------------------------ user1 |user1@ws.com | user1-key1 | 28 user1 |user1@ws.com | user1-key2 | 28 user1 |user1@ws.com | user1-key3 | 28 user2 |user2@ws.com | user2-key1 | 28 .............. user3 |user3@ws.com | user3-key1 | 50
the number of keys coming {key} parameter value can changed 1 number. how should write jmeter script achieve above target. tried use http://jmeter.apache.org/usermanual/functions.html#__split jmeter split function failed in applying split correctly. can please figure out way this?
i able resolve issue myself. below steps followed.
- adding beanshell sampler extract key string, split , set variable set. (var_{counterno})
- adding foreach controller read variables prefix of 'var' , set value output variable. output variable value has been used jdbc insert in jdbc sampler added under foreach controller..
Comments
Post a Comment