Friday, March 10, 2023

Generate a dynamic Transaction Name that starts with the script name, transaction number, and transaction description

Problem Statement:

Every start and end transaction in the script should have a name in the format "ScriptNo_AppName_ModuleName_TransactionNumber_ShortDescriptionOfAction".

Example: S01_OrangeHRM_User_Registration_T1_Launch_User_Register_Screen.

Note: Script name should be in following format "S01_OrangeHRM_User_Registration".

Solution:

The following function is to capture the Script Name, Script Name will be captured by tokenizing the script location path.


/*========================================================================
The following function is to generate Transaction Name. Please keep the "TName("<transactiondescription>")" funtion inside thee lr_start_transaction() and lr_end_transaction().

Example:

lr_start_transaction(TName("Search"));

web_custom_request{

};

lr_end_transaction(TName("Search"));
========================================================================*/


Git Repo:
 S001_Generate_Transaction_Name_Dynamically

Monday, February 20, 2023

Encode a value from HTML to URL format using JavaScript

LoadRunner Web HTTP/HTML Protocol has a function "web_convert_param()" that can encode values from HTML to URL format, however this function isn't work as expected.

Example: In this case, I'm looking to encode the following string "670523 X" from HTML to URL format.

In reality, the needed value is 670523%20X, but the output is "670523+X".
As a workaround for the above challenge, I have written custom JavaScript to encode the string into URL format, we will use this custom code in the "web_js_run" function.

Resolution:

Output: Encoded string to URL format = 670523%20X

Example:


Output: Encoded string to URL format = abshabhdgyuagdyuaduijbdauduiada0%40%401kdnfkdskfnsd%23%23%24%24%25ksksnk12345


Git Hub: web_js_run

YouTube: Coming Soon

Generate a dynamic Transaction Name that starts with the script name, transaction number, and transaction description

Problem Statement: Every start and end transaction in the script should have a name in the format "ScriptNo_AppName_ModuleName_Transact...