Skip to main content

Posts

What is HP loadrunner?

HPE   LoadRunner   is a software testing tool from Hewlett Packard Enterprise. It is used to test applications, measuring system behaviour and performance under load. Content Credits:  Wikipedia.org
Recent posts

Generating random string during execution

Consider we have a situation where we want to generate a random string of say length 5 (let’s say name of an employee) on the fly during our execution. Now one easy way would be to enter all possible permutations and combinations in our parameter file which would be 26 5 which would be roughly around 12 million. Well not exactly an “EASY” way. So another method is using lr_param_sprintf() function. Now lr_param_sprintf() function is just like standard C function sprintf(), only difference being that unlike the latter (which writes the output to a string buffer) the former’s output is written to a LoadRunner parameter. Syntax: int lr_param_sprintf(const char *paramName, const char *format[,args….]); This function returns a 0 on success, so if you get any non-zero value you know your function has failed. Prerequisite: You do need to prepare somethings before you can use this function. If you are using alphabets to create random string, then you should have a parameter with ...