Friday 4 October 2013

Printing the current log options to the output log (even if logging is disabled) in load runner

// Prints the current log options to the output log (even if logging is disabled)
// Example: xyz_print_log_options(lr_get_debug_message());
void xyz_print_log_options(unsigned int log_options_to_print) {
 char buf[(4 * 8) + 1]; // sizeof(unsigned int) is always 4 bytes in LoadRunner.
 unsigned int original_log_options = lr_get_debug_message();
 
 xyz_clear_log_options();
 xyz_set_log_options(LR_MSG_CLASS_BRIEF_LOG);
 
 // Print the bit pattern for the current log options.
 itoa(log_options_to_print, buf, 2);
 lr_output_message("Log options bit pattern: %032.32s", buf);
 
 lr_output_message("Log options selected:");
 
 if (log_options_to_print == 0) {
  lr_output_message("* Disabled (LR_MSG_CLASS_DISABLE_LOG)");
 } else {
 
  if (log_options_to_print & LR_MSG_CLASS_JIT_LOG_ON_ERROR) {
   lr_output_message("* Send messages only when an error occurs (LR_MSG_CLASS_JIT_LOG_ON_ERROR)");
  } else {
   lr_output_message("* Always send messages");
  }
 
  if (log_options_to_print & LR_MSG_CLASS_BRIEF_LOG) {
   lr_output_message("* Log messages at the detail level of \"Standard log\" (LR_MSG_CLASS_BRIEF_LOG)");
  }
 
  if (log_options_to_print & LR_MSG_CLASS_EXTENDED_LOG) {
   lr_output_message("* Log messages at the detail level of \"Extended log\" (LR_MSG_CLASS_EXTENDED_LOG)");
  }
 
  if (log_options_to_print & LR_MSG_CLASS_PARAMETERS) {
   lr_output_message("* Parameter substitution (LR_MSG_CLASS_PARAMETERS)");
  }
 
  if (log_options_to_print & LR_MSG_CLASS_RESULT_DATA) {
   lr_output_message("* Data returned by server (LR_MSG_CLASS_RESULT_DATA)");
  }
 
  if (log_options_to_print & LR_MSG_CLASS_FULL_TRACE) {
   lr_output_message("* Advanced trace (LR_MSG_CLASS_FULL_TRACE)");
  }
 }
 
 xyz_clear_log_options();
 xyz_set_log_options(original_log_options);
 
 return;
}
/*
Output looks like this:
globals.h(26): Log options bit pattern: 00000000000000000000001000011110
globals.h(28): Log options selected:
globals.h(35): * Send messages only when an error occurs (LR_MSG_CLASS_JIT_LOG_ON_ERROR)
globals.h(45): * Log messages at the detail level of "Extended log" (LR_MSG_CLASS_EXTENDED_LOG)
globals.h(49): * Parameter substitution (LR_MSG_CLASS_PARAMETERS)
globals.h(53): * Data returned by server (LR_MSG_CLASS_RESULT_DATA)
globals.h(57): * Advanced trace (LR_MSG_CLASS_FULL_TRACE)
*/

Turning off scripting errors - "MESSAGE FROM WEBPAGE" IN LOAD RUNNER

You may find you get pop-up messages in some WebbIE applications and more generally in Internet Explorer that tell you about scripting errors on the web page. Generally, unless you are a web developer, you just don't care about these messages and don't want them to appear. Turning them off won't hurt the operation of any program, so here is how to turn off scripting error messages in Internet Explorer. These messages say things like "Errors on this webpage might cause it to work incorrectly."

The first thing to try is turning off these messages in Internet Explorer:
Open Internet Explorer
Open the Tools menu (Alt and T)
Select the Internet Options item (O key)
The Internet Options dialog has many tabs. You need the Advanced tab. Press Control and Tab until you get to the Advanced Tab (that's six presses for Internet Explorer 8)
You should now be in a list, starting with Accessibility as the first item in Internet Explorer 8. This has the scripting options you want to change.
Cursor down to "Disable script debugging (Internet Explorer)" and press Space until it is on.
Cursor down to "Disable script debugging (Other)" and press Space until it is on.
Cursor down to "Display a notification about every script error" and press Space until it is off.
Press the Return key to close the Internet Options dialog. You should now have turned off the scripting errors.



Not worked? Here are some other things you can try:
Update Internet Explorer. You should be on the latest Internet Explorer, it's safer and better. You can get it from Windows Update. Start Internet Explorer, Alt and T for the Tools menu, then cursor down to Windows Update.
Change your antivirus program. These cause no end of trouble.
Set your Internet Explorer Security settings to Default. You do this again in the Internet Explorer Tools menu, Internet Options, Security tab, and click Default Level.
Delete your Internet Explorer temporary files and cookies and history. Internet Options, General tab. This will mean you'll have to re-enter your username and password in places where you've saved it, so make sure you know them all before you try this.