简体   繁体   中英

Loadrunner - how to parameterize changing value in VuGen for challenge questions to enter respective answers

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...

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"

...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM