LoadRunner web_reg_save_param, ord=all, paramName_count issues
18946 просмотра
4 ответа
I am using LoadRunner version 12.02 - Build 2739
Looking at an old, yet correct 'guide' shows that I have used the statements correctly (3rd Point, around 1/3rd of the way down the page, inside the code block - the atoi
statement).
But I am still unable to convert the _count parameter to an int-Variable.
In the script, before the call is made;
web_reg_save_param(
"ParamName=rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);
After the web call the save_param function is placed before, the output log shows;
Notify: Saving Parameter "ParamName=rotaPeople_count = 21".
Inside the script, after the call is made, and the count has been totaled;
lr_output_message("RP_C:%d",lr_eval_string("{rotaPeople_count}"));
lr_output_message("RP_C:%s",lr_eval_string("{rotaPeople_count}"));
peoplesCount = atoi(lr_eval_string("{rotaPeople_count}"));
lr_output_message("PC:%d",peoplesCount);
In the logs after the above executions are made;
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
RP_C:110826864
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
RP_C:{rotaPeople_count}
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
PC:0
Anyone have any ideas?
Note: The Warning messages are expected
Note: Workaround: Used web_reg_save_param_regex()
and created a regular expression. Using the returned _count parameter within a for-loop worked. Keeping question open, as the original problem still persists
Ответы (4)
1 плюс
The problem is that you use a soon to be deprecated API web_reg_save_param
which does not support the ParamName
syntax. In this API the second parameter is always the parameter name and therefore the correct use would be:
web_reg_save_param(
"rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);
The proper API to use is web_reg_save_param_ex
which does support the syntax you used so the call should look like:
web_reg_save_param_ex(
"ParamName=rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);
Then the rest of your code should work properly.
I am not sure what you are doing but you might want to take a look at the somewhat unknown API lr_paramarr_random
which will automatically pull a random value from the parameters array.
1 плюс
This should help you
web_reg_save_param(
"rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);
lr_output_message("PC:%d",atoi(lr_eval_string("{rotaPeople_count}")));
Автор: user2484633
Размещён: 17.02.2015 04:26
0 плюса
You are using ord=all,see the run time data which value you want to capture,If you want to capture the 10th value please use ord=10,automatically this warning will remove from output log.
Автор: arun mohanty Размещён: 10.01.2017 10:250 плюса
Example for capturing an array of dynamic values:
Action()
{
int i;
int ncount;
char ParamName[100];
web_set_sockets_option("SSL_VERSION", "TLS");
web_reg_save_param("trackingno","LB=;","RB= (NTN 0430)","search=All","ord=all",LAST);
web_submit_data("barcode.pl",
"Action=http://qtetools.rmtc.fedex.com/barcode/cgi-bin/barcode.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://qtetools.rmtc.fedex.com/barcode/html/barcode.shtml",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=formcode", "Value=0430", ENDITEM,
"Name=count", "Value=10", ENDITEM,
"Name=narrow", "Value=2", ENDITEM,
LAST);
ncount= atoi(lr_eval_string("{trackingno_count}"));
for (i =1;i <= ncount;i++)
{
sprintf(ParamName, "{trackingno_%d}", i);
lr_output_message("Value of %s: %s",ParamName,lr_eval_string(ParamName));
}
return 0;
}
Автор: teenaanie
Размещён: 25.01.2017 11:36
Вопросы из категории :
- parsing Как вручную проанализировать число с плавающей запятой из строки
- parsing Какой лучший способ прочитать и проанализировать большой текстовый файл по сети?
- parsing Каков наилучший способ для анализа времени в объект Date из пользовательского ввода в Javascript?
- parsing SQL: parse the first, middle and last name from a fullname field
- parsing Какой самый простой способ для анализа файла INI в Java?
- parsing Как разобрать строку в int в C ++?
- integer В чем разница между int и Integer в Java и C #?
- integer Конвертировать целые числа в записанные числа
- integer Преобразование списка <Integer> в список <String>
- integer Какое максимальное значение для int32?
- integer Показать номер с ведущими нулями
- integer Подписанные и неподписанные целые числа
- loadrunner Тестирование мобильного приложения для Android с использованием Loadrunner 11.5 выдает ошибку
- loadrunner Как параметризовать значения в скриптах ajax TruClient
- loadrunner LR v11.5 - Приложение не открывается во время записи
- loadrunner Как написать функцию Web_custom_request () в loadrunner
- loadrunner Протокол, используемый для настольного приложения в загрузке Runner 11
- loadrunner «Выбрать следующую строку» и «Обновленное значение включено» в параметризации Loadrunner