博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
调试消息函数lr_debug_message和lr_set_debug_message
阅读量:4201 次
发布时间:2019-05-26

本文共 1952 字,大约阅读时间需要 6 分钟。

 本文来自LR-VUG用户手册

可以使用 VuGen 的用户界面添加调试消息或错误消息。对于调试消息,可以指

示文本消息的级别(只有当指定的级别与消息类匹配时才发出该消息)。使用

lr_set_debug_message 可以设置消息类。

要插入调试函数,请执行下列操作:

1 依次选择“插入” > “新建步骤”。将打开“添加步骤”对话框。

2 选择“调试消息”步骤,然后单击“确定”。将打开“调试消息”对话框。

3 选择消息级别:“简要”或“扩展日志”。如果选择了“扩展日志”,请指示要

记录的信息的类型:“参数替换”、“结果数据”或“完全跟踪”。

4 在“消息文本”框中键入消息。

5 单击“确定”插入消息并关闭对话框。lr_debug_message 函数将插入到脚本的

当前点。

lr_debug_message基本用法

int lr_debug_message (unsigned int message_level, const char *format, ... );

message_level

One of the Message Log Run-Time Settings. Disabled does not apply.

format

A formatted string which is the message to be sent to the log file. You may use the standard Message Formatting that is available for printf.

The lr_debug_message function sends a debug message when the specified message level is active. If the specified message level is not active, a message is not issued. You can set the active message level to MSG_CLASS_BRIEF_LOG or MSG_CLASS_EXTENDED_LOG from the user interface or by using lr_set_debug_message. To determine the current level, use lr_get_debug_message.

Note that you can also specify multiple message levels with an OR separator ("|"). If any one of the levels are active (from the UI), the message is issued to the Output window. If none of the levels are active, the message is not issued.

The message is sent to the output window. To display the debug messages in the LoadRunner output window or Application Management agent log file, use the Expert Mode Settings. Activate Expert Mode (Tools > Expert Mode) and then choose Tools > Options > Debug Information and select the General check box.

例子:

In the following example, lr_debug_message issues a message to the log when either the Parameters Substitution or Result Data classes are set.

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON);

. . .

rc = lrd_fetch(Csr1, 1, 1, 0, PrintRow3);

if (rc>2000)

lr_debug_message(LR_MSG_CLASS_RESULT_DATA |         LR_MSG_CLASS_PARAMETERS, "Operation failed.");

【全文结束】

你可能感兴趣的文章
HP Sprinter:敏捷加速器
查看>>
单元测试培训PPT
查看>>
adb常用命令
查看>>
通过LR监控Linux服务器性能
查看>>
通过FTP服务的winsockes录制脚本
查看>>
LRwinsocket协议测试AAA服务器
查看>>
Net远程管理实验
查看>>
反病毒专家谈虚拟机技术 面临两大技术难题
查看>>
几种典型的反病毒技术:特征码技术、覆盖法技术等
查看>>
性能测试一般过程与LR性能测试过程
查看>>
Software Security Testing软件安全测试
查看>>
SQL注入漏洞全接触--进阶篇
查看>>
SQL注入漏洞全接触--高级篇
查看>>
SQL注入法攻击一日通
查看>>
菜鸟入门级:SQL注入攻击
查看>>
用vbs来写sql注入等80端口的攻击脚本
查看>>
C# 检查字符串,防SQL注入攻击
查看>>
关于对SQL注入80004005 及其它错误消息分析
查看>>
即时通软件性能测试(与宴宾的对话)
查看>>
应用软件性能测试的艺术(翻译)——序
查看>>