How to pass values of a parameter array as Item Datas in LR
I'm enhancing a Vuser Script in loadrunner 12.60, and as I mentioned in the question's title, I need to pass a group of item data to a form. These data are hidden so their values do not appear in the Data Items returned to the server in the recorded script. Now, I've extracted said values with a web_reg_save_param_ex, but the hidden inputs and their values are random, so maybe in one iteration I catch 5 elements and In another one I could catch more than 50.
I've made this section to know how many items are caught in the current iteration, it prints the name of the value and the value itself.
nameCnt = atoi(lr_eval_string("{nomf_count}"));
valCnt = atoi(lr_eval_string("{valf_count}"));
lr_output_message("Number of vars found = %d",nameCnt);
lr_output_message("Number of values found = %d",valCnt);
for (y = 1; y <= nameCnt; y++) {
sprintf(chainNom, "{nomf_%d}", y);
lr_output_message ("%s: %s", cadenaNom, lr_eval_string(cadenaNom));
sprintf(chainVal, "{valf_%d}", y);
lr_output_message ("%s: %s", cadenaVal, lr_eval_string(cadenaVal));
}
I have the name and the values extracted, but I don't know how to pass them as Data Items in the web_submit_form
Any help or even a push in the right direction would be appreciated.
Thanks in advance.
loadrunner
add a comment |
I'm enhancing a Vuser Script in loadrunner 12.60, and as I mentioned in the question's title, I need to pass a group of item data to a form. These data are hidden so their values do not appear in the Data Items returned to the server in the recorded script. Now, I've extracted said values with a web_reg_save_param_ex, but the hidden inputs and their values are random, so maybe in one iteration I catch 5 elements and In another one I could catch more than 50.
I've made this section to know how many items are caught in the current iteration, it prints the name of the value and the value itself.
nameCnt = atoi(lr_eval_string("{nomf_count}"));
valCnt = atoi(lr_eval_string("{valf_count}"));
lr_output_message("Number of vars found = %d",nameCnt);
lr_output_message("Number of values found = %d",valCnt);
for (y = 1; y <= nameCnt; y++) {
sprintf(chainNom, "{nomf_%d}", y);
lr_output_message ("%s: %s", cadenaNom, lr_eval_string(cadenaNom));
sprintf(chainVal, "{valf_%d}", y);
lr_output_message ("%s: %s", cadenaVal, lr_eval_string(cadenaVal));
}
I have the name and the values extracted, but I don't know how to pass them as Data Items in the web_submit_form
Any help or even a push in the right direction would be appreciated.
Thanks in advance.
loadrunner
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47
add a comment |
I'm enhancing a Vuser Script in loadrunner 12.60, and as I mentioned in the question's title, I need to pass a group of item data to a form. These data are hidden so their values do not appear in the Data Items returned to the server in the recorded script. Now, I've extracted said values with a web_reg_save_param_ex, but the hidden inputs and their values are random, so maybe in one iteration I catch 5 elements and In another one I could catch more than 50.
I've made this section to know how many items are caught in the current iteration, it prints the name of the value and the value itself.
nameCnt = atoi(lr_eval_string("{nomf_count}"));
valCnt = atoi(lr_eval_string("{valf_count}"));
lr_output_message("Number of vars found = %d",nameCnt);
lr_output_message("Number of values found = %d",valCnt);
for (y = 1; y <= nameCnt; y++) {
sprintf(chainNom, "{nomf_%d}", y);
lr_output_message ("%s: %s", cadenaNom, lr_eval_string(cadenaNom));
sprintf(chainVal, "{valf_%d}", y);
lr_output_message ("%s: %s", cadenaVal, lr_eval_string(cadenaVal));
}
I have the name and the values extracted, but I don't know how to pass them as Data Items in the web_submit_form
Any help or even a push in the right direction would be appreciated.
Thanks in advance.
loadrunner
I'm enhancing a Vuser Script in loadrunner 12.60, and as I mentioned in the question's title, I need to pass a group of item data to a form. These data are hidden so their values do not appear in the Data Items returned to the server in the recorded script. Now, I've extracted said values with a web_reg_save_param_ex, but the hidden inputs and their values are random, so maybe in one iteration I catch 5 elements and In another one I could catch more than 50.
I've made this section to know how many items are caught in the current iteration, it prints the name of the value and the value itself.
nameCnt = atoi(lr_eval_string("{nomf_count}"));
valCnt = atoi(lr_eval_string("{valf_count}"));
lr_output_message("Number of vars found = %d",nameCnt);
lr_output_message("Number of values found = %d",valCnt);
for (y = 1; y <= nameCnt; y++) {
sprintf(chainNom, "{nomf_%d}", y);
lr_output_message ("%s: %s", cadenaNom, lr_eval_string(cadenaNom));
sprintf(chainVal, "{valf_%d}", y);
lr_output_message ("%s: %s", cadenaVal, lr_eval_string(cadenaVal));
}
I have the name and the values extracted, but I don't know how to pass them as Data Items in the web_submit_form
Any help or even a push in the right direction would be appreciated.
Thanks in advance.
loadrunner
loadrunner
edited Jan 10 at 19:24
marc_s
577k12911141259
577k12911141259
asked Dec 31 '18 at 18:40
OmLpOmLp
1
1
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47
add a comment |
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47
add a comment |
2 Answers
2
active
oldest
votes
As said in the other comment, add the ITEMDATA under your custom/submit request:
ITEMDATA,
"Name=<Your Parameter Name>", "Value={your_param_value}", ENDITEM,
[...]
LAST;
add a comment |
You can try lr_param_sprintf() function instead of sprintf().
This will save your value into a Loadrunner parameter rather than a c parameter. This you can directly pass to your web_submit_form
lr_param_sprintf ("chainNom", "{nomf_%d}", y);
lr_param_sprintf (chainVal, "{valf_%d}", y);
....
ITEMDATA,
"Name={chainNom}", "Value={chainVal}", ENDITEM,
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53990486%2fhow-to-pass-values-of-a-parameter-array-as-item-datas-in-lr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As said in the other comment, add the ITEMDATA under your custom/submit request:
ITEMDATA,
"Name=<Your Parameter Name>", "Value={your_param_value}", ENDITEM,
[...]
LAST;
add a comment |
As said in the other comment, add the ITEMDATA under your custom/submit request:
ITEMDATA,
"Name=<Your Parameter Name>", "Value={your_param_value}", ENDITEM,
[...]
LAST;
add a comment |
As said in the other comment, add the ITEMDATA under your custom/submit request:
ITEMDATA,
"Name=<Your Parameter Name>", "Value={your_param_value}", ENDITEM,
[...]
LAST;
As said in the other comment, add the ITEMDATA under your custom/submit request:
ITEMDATA,
"Name=<Your Parameter Name>", "Value={your_param_value}", ENDITEM,
[...]
LAST;
answered Jan 10 at 10:53
twingetwinge
6015
6015
add a comment |
add a comment |
You can try lr_param_sprintf() function instead of sprintf().
This will save your value into a Loadrunner parameter rather than a c parameter. This you can directly pass to your web_submit_form
lr_param_sprintf ("chainNom", "{nomf_%d}", y);
lr_param_sprintf (chainVal, "{valf_%d}", y);
....
ITEMDATA,
"Name={chainNom}", "Value={chainVal}", ENDITEM,
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
add a comment |
You can try lr_param_sprintf() function instead of sprintf().
This will save your value into a Loadrunner parameter rather than a c parameter. This you can directly pass to your web_submit_form
lr_param_sprintf ("chainNom", "{nomf_%d}", y);
lr_param_sprintf (chainVal, "{valf_%d}", y);
....
ITEMDATA,
"Name={chainNom}", "Value={chainVal}", ENDITEM,
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
add a comment |
You can try lr_param_sprintf() function instead of sprintf().
This will save your value into a Loadrunner parameter rather than a c parameter. This you can directly pass to your web_submit_form
lr_param_sprintf ("chainNom", "{nomf_%d}", y);
lr_param_sprintf (chainVal, "{valf_%d}", y);
....
ITEMDATA,
"Name={chainNom}", "Value={chainVal}", ENDITEM,
You can try lr_param_sprintf() function instead of sprintf().
This will save your value into a Loadrunner parameter rather than a c parameter. This you can directly pass to your web_submit_form
lr_param_sprintf ("chainNom", "{nomf_%d}", y);
lr_param_sprintf (chainVal, "{valf_%d}", y);
....
ITEMDATA,
"Name={chainNom}", "Value={chainVal}", ENDITEM,
answered Jan 11 at 6:31
Akash BarikAkash Barik
335
335
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
add a comment |
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
Hello, thanks for your response, I didn't know about lr_param_sprintf, I'm dealing with UFT now but when I can I'll give it a try. In the submit form, there's no need to do a for or a while loop to insert the parameters?
– OmLp
Jan 16 at 1:05
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53990486%2fhow-to-pass-values-of-a-parameter-array-as-item-datas-in-lr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
use web_custom_request() and build your own name|value pair structure
– James Pulley
Jan 1 at 3:47