LoadRunner Functions

March 27, 2018 | Author: Rohit Khurana | Category: Parameter (Computer Programming), Ip Address, Computer Programming, Computing, Technology


Comments



Description

Informational Functions     lr_get_host_name ( ) lr_get_master_host_name ( ) lr_get_vuser_ip( ) lr_start_timer () lr_end_timer Abhranil Ghosh lr_get_host_name ( ) Returns the name of the host executing the Vuser script. Example char * my_host; my_host = lr_get_host_name( ); lr_output_message("%s", my_host); /*sends the message to the output window*/   Abhranil Ghosh controller_host=lr_get_master_ho st_name().lr_get_master_host_na me ( ) Returns the name of the machine running the Controller .  Abhranil Ghosh .  Example char * controller_host. ip). ip = lr_get_vuser_ip().  Example char *ip.lr_get_vuser_ip( ) Returns the IP address of the current Vuser.  Abhranil Ghosh . lr_output_message("The IP address is %s". Example Double timer . time_elapsed timer = lr_start_timer(). Abhranil Ghosh .lr_start_timer () lr_end_timer ()   & starts and stops a timer that calculates the passage of time in seconds. /* script */ time_elapsed = lr_end_timer(timer). Message Functions lr_message()  lr_error_message()  lr_vuser_status_message()  Abhranil Ghosh . lr_message() Sends a message to the Output window.  Abhranil Ghosh .  Example lr_message (“Login completed”). Example lr_error_message(“Login Failed”). Abhranil Ghosh  .lr_error_message()  Sends an error message to the Output window. Example lr_vuser_status_message (“Started”). Abhranil Ghosh .lr_vuser_status_message()   Sends a message to the Vuser status area in the Controller. Run-Time Functions lr_abort( )  lr_rendezvous()  lr_think_time ()  Abhranil Ghosh .  Example  if (transaction = = LR_FAIL) { lr_abort(). } Abhranil Ghosh .lr_abort( ) Aborts Vuser script execution. lr_rendezvous() Creates a rendezvous point in the Vuser script.  Example lr_rendezvous (rendezvous name).  Abhranil Ghosh .  Example lr_think_time (double time).lr_think_time () Pauses execution between commands in a Vuser script.  Abhranil Ghosh . String Functions lr_decrypt ()  lr_save_string()  lr_save_datetime()  Abhranil Ghosh . Abhranil Ghosh .lr_decrypt ()   Decrypts an encoded string Example lr_decrypt("38620da61ca1093e7aa7ec") .  Result Saves 777 to the parameter Id.  Example lr_save_string("777".  Abhranil Ghosh . “Id").lr_save_string() Saves a string to a parameter. DATE_NOW. Example lr_save_datetime(" %B %d %Y". “tdate") Output Saves the date in month/date/year format in the parameter tdate Abhranil Ghosh .lr_save_datetime()    Assigns the current date and time to a parameter. Transaction Functions lr_start_transaction()  lr_end_transaction()  lr_get_transaction_status()  lr_get_transaction_duration()  Abhranil Ghosh . lr_start_transaction() Marks the beginning of a transaction  Example lr_start_transaction("deposit").  Abhranil Ghosh .  Example lr_end_transaction("deposit".  LR_FAIL).lr_end_transaction() Marks the end of a transaction and records the amount of time it took to perform the transaction. Status Abhranil Ghosh . } Abhranil Ghosh . Example if (lr_get_transaction_status() == LR_FAIL) { lr_output_message(“Transaction Failed”).lr_get_transaction_status()   Returns the current status of a transaction. lr_get_transaction_durat ion() Returns the duration of a transaction. lr_start_transaction ("Flight"). trans_time=lr_get_transaction_durati on("Flight"). lr_end_transaction("Flight".  Abhranil Ghosh . LR_PASS).  Example double trans_time.
Copyright © 2024 DOKUMEN.SITE Inc.