Highlighted
Regular Contributor.
Regular Contributor.
140 views

How to print messages on the Messages of Performance Center

Jump to solution

Hello All

I am struggling with what apparently is a simple task. I need to print during a execution a text with timestamp when a validation fails. However, I have tried with lr_log_message and lr_output_message without luck.

I already enabled the logging in the runtime settings of the Performance Center scenario. The settings setup is:

* Enable " Log when error occurs and limit log cache to 1kb"

* Extended log, enabling parameter substitution.

* Enable "Print timestamp for 'Message functions' "

The function used is quite simple:

if( (atoi(lr_eval_string("{checkPage}"))>0) && (atoi(lr_eval_string("{checkErrorPage}"))==0)){
lr_end_transaction("Transaction01",LR_PASS);
}
else
{
lr_end_transaction("Transaction01",LR_FAIL);
lr_log_message("Transaction01 faliled - HTTP Code: %d", responseCodePageHTTP);

}

However, when I go to the tab of messages in Performance Center, I don´t see any of these messages. As well, I am not seeing them in the vuser log.zip or in the output.mdb file.

The version of LR and PC that I am using is 12.62

Any idea on what I am missing? 

Thank you in advance!

 

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to print messages on the Messages of Performance Center

Jump to solution

Hi @Ageo ,

If you enabled " Log when error occurs ... ", then only error logs can be outputted. In this case, you should use lr_error_message( ) to output your log.

Another way is to disable " Log when error occurs ... ", then lr_log_message( ) should work.

 

Thanks,

Penn

 

View solution in original post

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to print messages on the Messages of Performance Center

Jump to solution

Hi @Ageo ,

If you're willing to see the entire log, you need to uncheck RTS option "accumulate message in memory ...", so that it can write log into physical log file.

Thanks,

Penn

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: How to print messages on the Messages of Performance Center

Jump to solution

Hi @Zhipeng Wang 

I think that option is only available on the RTS of TruClient. I don´t see that in the Web script type.

Any other option to print messages to the "Messages" Tab in Performance Center during an execution? Or at least to the vuser log?

Thank you in advance!

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to print messages on the Messages of Performance Center

Jump to solution

Hi @Ageo ,

If you enabled " Log when error occurs ... ", then only error logs can be outputted. In this case, you should use lr_error_message( ) to output your log.

Another way is to disable " Log when error occurs ... ", then lr_log_message( ) should work.

 

Thanks,

Penn

 

View solution in original post

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: How to print messages on the Messages of Performance Center

Jump to solution

Worked like a charm! Thank you @Zhipeng Wang 

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.