Skip to main content

How to write or print data in notepad using append mode?

We can use the below function to print a value in notepad using append mode, it will keep on adding the data in notepad. This function can be used for data filtration from a parameter file.

long fd;
char buff[100];

web_reg_save_param("cRequest_id","LB=---","RB=---","ORD=1",Last);

//Before closing the Action

strcpy( buff,lr_eval_string("{cRequest_id}") );

fd=fopen( "C:\\NotepadName.txt","a" );

fprintf( fd,"%s\n",buff );

fclose( fd );
}

In this example we are capturing the cRequest_id from correlation and printing in notepad.

Comments

  1. I just wanted to say this is an elegantly composed article as we have seen here. I got some knowledge from your article and also it is a significant article for us. Thanks for sharing an article like this.Flat Heat Press Machine Price

    ReplyDelete


  2. Thanks for sharing, if you want more benefits then remain connect with us.

    ProShow Producer Crack

    ReplyDelete
  3. This site have particular software articles which emits an impression of being a significant and significant for you individual, able software installation.
    proshow-producer-crack
    daemon-tools-pro-crack
    sam-broadcaster-pro-crack
    utorrent-pro-crack
    system-mechanic-pro-crack

    ReplyDelete

Post a Comment

Popular posts from this blog

Pacing Time in LoadRunner

What is Pacing? Where and why to use it? -Pacing is the time which will hold/pause the script before it goes to next iteration. i.e Once the   Action   iteration is completed the script will wait for the specific time(pacing time) before it starts the next one. It works between two actions. eg, if we record a script there will be three default actions generated by the Load Runner:   vuser_init, Action   and   vuser_end,   the pacing will work after the   Action   block and hold the script before it goes to repeat it. The default blocks generated by LoadRunner is shown below: Actions marked in Red Now we know what is pacing and we use it between two iteration. The next question comes to mind is why we use pacing: Pacing is used to: To control the number of TPS generated by an user. To control number of hits on a application under test.     Types of Pacing: There are three options to control the pacing in a script: General Pacing:    1. As soon

Error handling using Text Check

Error handling using if else condition. web_reg_find("Search=All",                      "Text/IC=Home Page",                      "SaveCount=home_count",                       LAST); //then after login block paste this code: if (atoi(lr_eval_string("{home_count}")) > 0)                 {                       lr_output_message("Log on Successful");                 }     else               {                     lr_output_message("Log on failed for the Login ID: %s", lr_eval_string("{pUserName}"));                     lr_exit( LR_EXIT_ACTION_AND_CONTINUE,LR_FAIL );                }

String Comparison in Loadrunner script

How to compare a string in Loadrunner script? -There are various methods to compare a string, in below example we have used "strcmp" to compare two values. We have captured a string in "pComparisonString" parameter and comparing it with ABC. Lets say if you have captured some string using correlation and want to compare if the captured string meets the condition then only pass the transactions else fail the transaction: if (strcmp(lr_eval_string("{pComparisonString}"),"ABC") == 0) { lr_output_message("The parameter value is %s", lr_eval_string("{pComparisonString}")); lr_end_transaction("Transaction_Failed",LR_FAIL); } else { lr_error_message("No parameter value captured."); lr_end_transaction("Transaction_Passed",LR_PASS); } -------------------------------------------------------- strcmp- String comparison function. pComparisonString- String which we have captured for compar