Monday, June 10, 2013

JMeter Random String [A-Z,a-z,0-9]


Random String


Generate a random string using [A-Z,a-z,0-9]



For generating a random string length of 5 then use the below function


Name: randomstr5

${__RandomString(5,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,)}

For generating a random string length of 10 then use the below function


Name: randomstr10

${__RandomString(10,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,)}

BeanShell script for Date Time format yyyyMMdd HH:mm:ss.SSS



Add the below code in User Parameters to generate the date time format like 


yyyyMMdd HH:mm:ss.SSS



Name: DateTime

Variable: ${__BeanShell(new java.text.SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS").format(new Date()))}