I want to upload a unique file every time a VUser script is ran (as in the # of vusers in the Controller scenario) and I found some examples on different forums and out them together to try to accomplice this task:
Action()
{
char command[100];
sprintf(command, “copy C:\\source_dir\\srcFile.txt C:\\source_dir\\srcFile-%s.txt”,
lr_eval_string (”{iteration_number}”));
system(command);
web_submit_data("FileUpload",
"Action={URL}",
"Method=POST",
"EncType=multipart/form-data",
"TargetFrame=",
"RecContentType=text/html",
"Mode=HTML",
ITEMDATA,
"Name=File", "Value=C:\\source_dir\\srcFile-%s.txt", "File=yes", ENDITEM,
LAST);
sprintf(command, “del C:\\source_dir\\srcFile-%s.txt”, lr_eval_string (”{iteration_number}”));
system(command);
return 0;
}
However this script does create 100 files each time and that is not what I want to accomplice. 1.How can I modify my script to create 100 unique files (once). 2.Then run the upload (web_submit_data function) once per VUser in the controller. 3.And then delete the files in the end?
Maybe put the file generation in the init and the file deleting in the end part of the VUser script?