我已经复制了可以访问另一个数据库的Vu脚本(当然还有它),当我运行它时,我在输出中有旧脚本的旧事务名称。 / p>
这是旧的交易名称,将在输出中看到: MDM_GetAssociations 以下是重命名的交易: MDM_GET_ASSOCIATIONS_Otmann
重命名事务后,我运行脚本,我得到2个错误: 1) 错误14未声明的标识符`MDM_GET_ASSOCIATIONS_Otmann' Action.c C:\ GCDM_Test \ Scripts \ MDM \ MDM_Get_POSTGRE_Otmann MDM_Get_POSTGRE_Otmann
2)
参数1中的错误15类型错误web_custom_request'; found
int'期望`指向const char的指针' Action.c C:\ GCDM_Test \ Scripts \ MDM \ MDM_Get_POSTGRE_Otmann MDM_Get_POSTGRE_Otmann
这是我的剧本:
//########## start the test scenario ############
web_set_max_html_param_len("8000");
web_set_sockets_option("SSL_VERSION", "TLS");
web_add_auto_header("Content-Type","application/xml");
web_add_auto_header("Accept","application/json");
web_add_auto_header("Authorization",lr_eval_string("{AUTHORIZATION}"));
//GetAssociations, NOTE: our dummy customers have often NO associations!
web_reg_save_param("RESPONSE", "LB=", "RB=", "Search=Body", LAST);
lr_start_transaction((char*)MDM_GENERIC_TRANSACTION);
lr_start_transaction((char*)MDM_GET_ASSOCIATIONS);
web_custom_request(MDM_GET_ASSOCIATIONS,
"URL={TEST_ENV_HOSTNAME}/api/v3/clients/{BUSINESS_CONTEXT}/customers/{GCID}/associations",
"Method=GET",
"Resource=1", // => We are retrieving a ressource,
// which implies that it is not critical for the success of the script.
// Any failures (HTTP 404 - Not found etc.) in downloading the resource
// will be considered as warnings rather than errors.
"EncType=application/xml",
"Referer=Loadrunner",
LAST);
lr_end_transaction((char*)MDM_GET_ASSOCIATIONS, LR_AUTO);
lr_end_transaction((char*)MDM_GENERIC_TRANSACTION, LR_AUTO);
return 0;
}
这是旧事务名称的输出(MDM_GetAssociations),但我不知道她编码的位置或者她来自哪里,正如我之前所说的那样,当我尝试在所有位置更改它时这与交易有关,我得到了上面提到的错误。
这是脚本的输出,您可以在其中看到旧事务的名称(MDM_GetAssociations)。
Action.c(13): Notify: Transaction "MDM_GenericServiceCall_ALL" started.
Action.c(14): Notify: Transaction "MDM_GetAssociations" started.
Action.c(15): web_custom_request("MDM_GetAssociations") started
Action.c(15): web_custom_request("MDM_GetAssociations") highest severity level was "warning", 505 body bytes, 1971 header bytes [MsgId: MMSG-26388]
Action.c(25): Notify: Transaction "MDM_GetAssociations" ended with "Pass" status (Duration: 1,8408 Wasted Time: 1,2668).
Action.c(26): Notify: Transaction "MDM_GenericServiceCall_ALL" ended with "Pass" status (Duration: 2,4066 Wasted Time: 1,2668).
Ending action Action.
Ending iteration 1.
答案 0 :(得分:1)
你有两个变量。你这里没有他们的声明。你没有他们的内容。并且您似乎将它们从另一种数据类型转换为指向字符的指针。
这是否通过了文字," My_Test_Transaction"?如果是这样,那么你可能会看到关于如何声明,填充和引用变量的奇怪之处。