0

Loadrunner - how to parameterize changing value in VuGen?

Example: Challenge questions change every time when you try to login and answers to be parameterized according to the question that is displayed.

Challenge question answer logic is that the last word of the question is the answer to be parameterized.

Example: What is your name? Here "name" is the answer for the challenge question.

My scenario is that 3 challenge questions will be populated and 3 answers to be entered, we don't know which question will be populated in what order or so...

tshepang
  • 12,111
  • 21
  • 91
  • 136
Ramanan
  • 11
  • 1
  • 4

2 Answers2

1

Make all of your challenge questions and answers the same for your test users. Correlate for the question. Check for a match to the question and then set the response for the form.

"What is your name?" "Bob"

"What was the name of your first pet?" "Cat"

"What is the name of your elementary school" "My School"

...

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • Hi James, Thanks for your response. I would like to know how to make the script work for entering the respective answers for the appeared questions and answer as last word of the appeared question ther are only 3 questions that appear on page out of total 6 questions,which will appears in any order. any custom code? plz help with script Thanks... – Ramanan Nov 03 '13 at 17:33
  • Script may solve your problem but that is not the correct solution to your problem. Go with what James has suggested. You already know the questions and hence know the answers. You should think about a script only if you don't know the questions/answers, even then there are alternatives. James's solution is easy to implement and best of all you avoid the problem that comes with adding inexperienced custom C code. – Abhishek Asthana Nov 25 '13 at 18:46
1

FYI got it solved by using array in web_reg_sav_param function here we go... I placed below function above the right place(refering the questions .inf position in the generation log) web_reg_save_param("CQ", "LB= ", "RB=?", "Ord=ALL", "Search=Body", LAST); then replaced answers with {CQ_1},{CQ_2} and {CQ_3} since i had 3 answers(pasted 2 time each as CQ_ , as i had same answers twice)

web_submit_form("answerChallengeQuestions.faces",
     "Snapshot=t74.inf",
    ITEMDATA,
    "Name=answerChallengeQuestions:answerPasswordBox1", "Value={CQ_1}", ENDITEM,
    "Name=answerChallengeQuestions:answerTxtBox1", "Value={CQ_1}", ENDITEM,
    "Name=answerChallengeQuestions:answerPasswordBox2", "Value={CQ_2}", ENDITEM,
    "Name=answerChallengeQuestions:answerTxtBox2", "Value={CQ_2}", ENDITEM,
    "Name=answerChallengeQuestions:answerPasswordBox3", "Value={CQ_3}", ENDITEM,
    "Name=answerChallengeQuestions:answerTxtBox3", "Value={CQ_3}", ENDITEM,

Hope this helps

Thanks, Ramanan M

Ramanan
  • 11
  • 1
  • 4