Attached is the sample loadrunner file
Example Description
In this example we are doing following activities via a loadrunner script
1. Create a direcotry named speforums in your C drive.
2. Execute a ping command and save it as a file inside c://speforums directory.
Sample code
Attached is the working script file.
Final Output:
Contents of the file:
Example Description
In this example we are doing following activities via a loadrunner script
1. Create a direcotry named speforums in your C drive.
2. Execute a ping command and save it as a file inside c://speforums directory.
Sample code
Code:
char filename[1024], command[1024];
//define directory name
char new_dir[] = "C:\\speforums";
// Create a directory under root called xyz and make it the current dir
if (mkdir(new_dir))
lr_output_message ("Create directory %s failed", new_dir);
else
lr_output_message ("Created new directory %s", new_dir);
//Define a filename
sprintf(filename, "%s\\%s", new_dir, "pingfile_speforums.txt");
// Execute a ping command and direct it to a new file
sprintf(command, "ping speforums.com >> %s", filename);
system(command);
lr_output_message ("Created new file %s", filename);
Final Output:
Contents of the file: