TA的每日心情 | 郁闷 2015-6-16 14:29 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
大家好,在学习LOADRUNNER的过程中遇到如下问题;
本次脚本是录制一个在线考试系统,自动生成试题后,考生答题,然后提交的过程.
1,在下面的脚本中,红色字体中的id每次都会自动变化,并且每一个用户登陆后生成的id都不一样,经过分析,这个id是递增的,每次试题共15题,id也是从某一个数字递增,可做参数化,但做后有一个问题是:这个id与页面信息不匹配(web_url()中的值),就是说试题的id虽然是递增的,但是并没有按照一个升序或降序的方法排列,导致测试过程中,页面名称与实际试题id对不上,无法起到参数化的效果.
罗嗦了很多,不晓得大家能否明白我的意思.现在需要解决的是如何将这个问题解决,能让参数化起到效果.
submitexam()
{
lr_think_time(10);
web_url("test_saveanswer.asp",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1833",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_2",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1834",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_3",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1844",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_4",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1839",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_5",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1843",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_6",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1840",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_7",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1832",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_8",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1837",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_9",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1836",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_10",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1835",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_11",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1838",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_12",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1846",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_13",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1845",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_14",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1842",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(10);
web_url("test_saveanswer.asp_15",
"URL=http://192.168.0.103/exam/test_saveanswer.asp?answer=1&id=1841",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(20);
web_url("testfinish.asp",
"URL=http://192.168.0.103/exam/testfinish.asp?action=submitexam&prjid=23&studentid=222",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
return 0;
}
[ 本帖最后由 森林一木 于 2007-12-23 14:27 编辑 ] |
|