I'm relatively new to LoadRunner, doing fine but having some fundamental problems. I seem to always want to treat LoadRunner parameters as regular variables but cannot. I especially have problems with integers as LR parameters always seem to be strings. All of the examples provided in the online help use literal strings in quotes, which is hardly helpful.
For instance, if I retrieve a parameter "recordcount" I want to be able to do "if(recordcount > 5) logic.
Another example is when using the web_create_html_param_ex function, the last parameter is an instance number, but it has to be a string!
Do I have to roll all this stuff myself using C (which I suck at)? If there are built in functions for these things I sure can't find them.
Appreciate any direction you can provide! Working on a deadline here!
If you are using small counts 0-9 or the numbers are front loaded with 0's then a string comparison will use strcmp(str1,str2) results a 0 for equal -1 and 1 less than and greater than.
Else as far as I know you have to save the parameter as a string lr_save_string then convert using something like strtol.
The other way would be from number to string using sprintf to parameter via lr_save_string.
Thanks Russ. The sprintf etc. method was what I ended up doing. I guess I just couldn't believe that LoadRunner didn't have specific functions for that sort of thing. Looks like I'm going to have to dust off my Kernighan and Ritchie.
I'm not really the best person to ask as I only came into LR by accident in my current job. The majority of the jobs in the city come through agencies. A lot of the big banks etc only recruit through particular agencies.
The way they are organised it is difficult to go to one place for a specific job. You have to join a number of agencies in different area ie telecoms, banking etc. And then look for jobs that require the skill you want to use.
There are a lot of web sites that advertise jobs as well. Search these for LR and you may find some agencies that are more specialised. QA Forums also has a jobs section.
If you want to convert a number which is a string into an integer you can use the atoi() function. If you have "21" and want to make it 21 then do (variable) = atoi("21"); This converts the ascii value of the number to the intger value for you.
Simple minds, Simple thoughts!
I figure if you have the courage to get out of bed in the morning, then how bad can the day be.
I want to add that if you use c poprgramming in the script the best thing to do is to include the header files like stdio.h
in LoadRunner script based c programming alwayes have problem with the int variables