Hi,
I am new to Loadrunner and facing an error. Genius please help me out.
I am trying to generate a unique file name by invoking userid,iteration number and date/time as a parameter. Once this character is generated I am trying to use it to create a file name with .pdf extension.
However,at the end of the iteration, I am getting error : Warning:Invalid parameter detected in function for step 9 i.e fclose(fp).
Please suggest as what could be corrective action. PFB code which is being used.
1.int fp;
2.int k;
3.unsigned long prmLen;
4. lr_save_string(lr_eval_string("{VuserId}_{Iteration}_{Date_Time}.pdf"),"k");
5. lr_output_message(lr_eval_string("filename is %s{k}"));
6. web_set_max_html_param_len("20000000");
7. fp=fopen(lr_eval_string("{k}"),"wb");
//Write the data saved to an output file.
8.fwrite(data, prmLen, 1, fp);
//Close the file pointer.
9.fclose(fp);
RESULT:
At the end of the iteration, I am getting error : Warning:Invalid parameter detected in function for step 9 i.e fclose(fp).
--
Also point no. 6. Don't use that big of a value. You will end up eating lot of memory of you load generator
You will turn your load generator into a bottleneck for your entire test. You need to ask yourself why you are saving off PDF files when this will have a negative impact on your overall test design. You note that you are new to LoadRunner, and presumably performance testing as well.
Take a step back and look at your test design. What is the requirement which is dictating your path to save files? Your current path will result in a distressed load generator related to disk access from direct file saves and memory swaps as you exceed physical RAM. Are you combining functional requirements with your performance test design?
You have a conceptual and code issue impacting the variable ‘k.’ You will have a response time issue when writing out the data during an open transaction. Virtual User ID + <underscore>+time to the second+underscore+random two digit number will provide distinctness. However this is a path not recommended due to the negative impact on the execution of your performance test.
James Pulley
--