1. SPEForums need your contributions to build up a strong repository of performance engineering resources.

    Dismiss Notice
Dismiss Notice
Hello Guest,

Please reach out to us at anmldubey@gmail.com in case you face any issues with SPEForums. Share your feedback - Click Here

Please support us by sharing performance engineering tutorials/resources with SPEForums.com


System Command Example In Loadrunner 2017-12-05

Making a command line (CMD) call through loadrunner

  1. admin
    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

        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);
            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);
        lr_output_message ("Created new file %s", filename);
    Attached is the working script file.

    Final Output:


    Contents of the file:



    1. upload_2017-12-5_23-13-8.png