51Testing软件测试论坛
标题: 【急】录制在线考试,回放不成功 [打印本页]
作者: zengli80 时间: 2011-8-18 21:23
标题: 【急】录制在线考试,回放不成功
本帖最后由 zengli80 于 2011-8-24 22:41 编辑
录制在线考试,回放不成功,web_submit_form("PUB_Online_Test.aspx",总是报错
Action()
{
web_add_cookie("hblb=hblb; DOMAIN=test5");
web_reg_save_param("Siebel_Analytic_ViewState1",
"LB/IC=pstrCheckNO=",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
web_url("login.aspx",
"URL=http://test5/etacp/Business/pub/webpub/PUb_Online/login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/etacp/images/login1/webLogin_5.gif", ENDITEM,
"Url=/etacp/images/login1/webLogin_13.gif", ENDITEM,
"Url=/etacp/images/login1/webLogin_10.gif", ENDITEM,
"Url=/etacp/Images/css/textbox.css", ENDITEM,
"Url=/etacp/images/login1/webLogin_24.gif", ENDITEM,
"Url=/etacp/images/login1/webLogin_26.gif", ENDITEM,
"Url=/etacp/images/login1/webLogin_27.gif", ENDITEM,
LAST);
web_submit_form("login.aspx_2",
"Snapshot=t2.inf",
ITEMDATA,
"Name=strUserAccount", "Value=420204198008126554", ENDITEM,
"Name=strChechNO", "Value={Siebel_Analytic_ViewState1}", ENDITEM,
"Name=btnLogin.x", "Value=49", ENDITEM,
"Name=btnLogin.y", "Value=15", ENDITEM,
EXTRARES,
"Url=images/bg_mid.gif", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Info.aspx?pExamNum=420204198008126554", ENDITEM,
LAST);
web_submit_form("PUB_Online_Info.aspx",
"Snapshot=t3.inf",
ITEMDATA,
"Name=imgbtnEnter.x", "Value=45", ENDITEM,
"Name=imgbtnEnter.y", "Value=5", ENDITEM,
EXTRARES,
"Url=images/left_mid.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
"Url=images/main_m.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
LAST);
web_submit_form("PUB_Online_Test.aspx",
"Snapshot=t4.inf",
ITEMDATA,
"Name=nLimitTime", "Value=60", ENDITEM,
"Name=dtRemainTime", "Value=3597", ENDITEM,
"Name=dgrdRadio:_ctl2:radlAnswer1", "Value=C", ENDITEM,
"Name=nextIndex", "Value=1", ENDITEM,
"Name=totalquestion", "Value=0", ENDITEM,
"Name=Indexanswered", "Value=0", ENDITEM,
"Name=strSjRecGuid", "Value=5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0", ENDITEM,
"Name=strKsAccount", "Value=xy5", ENDITEM,
"Name=imgbtnNext.x", "Value=79", ENDITEM,
"Name=imgbtnNext.y", "Value=13", ENDITEM,
EXTRARES,
"Url=images/left_mid.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
"Url=images/main_m.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
LAST);
web_submit_form("PUB_Online_Test.aspx_2",
"Snapshot=t5.inf",
ITEMDATA,
"Name=nLimitTime", "Value=60", ENDITEM,
"Name=dtRemainTime", "Value=3593", ENDITEM,
"Name=dgrdRadio:_ctl2:radlAnswer1", "Value=<OFF>", ENDITEM,
"Name=nextIndex", "Value=2", ENDITEM,
"Name=totalquestion", "Value=0", ENDITEM,
"Name=Indexanswered", "Value=0", ENDITEM,
"Name=strSjRecGuid", "Value=5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0", ENDITEM,
"Name=strKsAccount", "Value=xy5", ENDITEM,
"Name=btnOverTest.x", "Value=37", ENDITEM,
"Name=btnOverTest.y", "Value=9", ENDITEM,
EXTRARES,
"Url=images/left_mid.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
"Url=images/main_m.jpg", "Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf", ENDITEM,
LAST);
web_submit_data("PUB_Online_Test.aspx_3",
"Action=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?pEvent=Over",
"Method=POST",
"RecContentType=text/html",
"Referer=http://test5/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx?ExamPaperCode=b6b9594d-1349-497c-9b36-09a7ecf8a550|fc254454-d7f3-4d8e-acdd-a840b7be8203|5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0|8a87dfac-0476-422f-84bb-2cc3be5e63f5|ce48acf9-e62b-4342-9c2b-49da252b265e&ExamGuid=0e55b0b2-30f6-4ee0-8abb-827767d1615a&pExamNum=420204198008126554&pAccount=xy5&pClassCode=00010101013a1eaf15-0691-471c-9d4e-cda9a64efaaf",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=__VIEWSTATE", "Value=dDwtMTE5MDkyODkxO3Q8cDxsPHBFeGFtTnVtO2h0O2h0TWFyaztkdGJsOz47bDw0MjAyMDQxOTgwMDgxMjY1NTQ7aDw1Y2UzNGM0NS00MzA5LTQ4MWEtYWJiYi1hZmQ0OGQ1ZjAxMTY7Qzs+"
"O2g8PjtiPEFBRUFBQUQvLy8vL0FRQUFBQUFBQUFBTUFnQUFBRkZUZVhOMFpXMHVSR0YwWVN3Z1ZtVnljMmx2YmoweExqQXVOVEF3TUM0d0xDQkRkV3gwZFhKbFBXNWxkWFJ5WVd3c0lGQjFZbXhwWTB0bGVWUnZhMlZ1UFdJM04yRTFZelUyTVRrek5HVXdPRGtGQVFBQUFCVlRlWE4wWlcwdVJHRjBZUzVFWVhSaFZHRmliR1VDQUFBQUNWaHRiRk5qYUdWdFlRdFliV3hFYVdabVIzSmhiUUVCQWdBQUFBWURBQUFBeGhzOFAzaHRiQ0IyWlhKemFXOXVQU0l4TGpBaUlHVnVZMjlrYVc1blBTSjFkR1l0TVRZaVB6NE5Dang0Y3pwelkyaGxiV0VnYVdROUluUnRjRVJoZEdGVFpYUWlJSGh0Ykc1elBTSWlJSGh0Ykc1ek9uaHpQU0pvZEhSd09pOHZkM2QzTG5jekxtOXlaeTh5TU"
作者: zengli80 时间: 2011-8-18 21:26
这个在线考试就是身份证登录后开始答题,回放总是报错,找了半天原因也不知道怎么弄,请高手指点一二
Action.c(52): To location "http://test5/etacp/BSPlat/CommonPage/Error.aspx?aspxerrorpath=/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx" [MsgId: MMSG-26693]
Action.c(52): Found resource "http://test5/etacp/BSPlat/CommonPage/images/customize.js" in HTML "http://test5/etacp/BSPlat/CommonPage/Error.aspx?aspxerrorpath=/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx" [MsgId: MMSG-26659]
Action.c(52): Found resource "http://test5/etacp/BSPlat/CommonPage/css/css.css" in HTML "http://test5/etacp/BSPlat/CommonPage/Error.aspx?aspxerrorpath=/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx" [MsgId: MMSG-26659]
Action.c(52): Found resource "http://test5/etacp/images/error_hand.gif" in HTML "http://test5/etacp/BSPlat/CommonPage/Error.aspx?aspxerrorpath=/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx" [MsgId: MMSG-26659]
Action.c(52): Found resource "http://test5/images/line_bg.gif" in HTML "http://test5/etacp/BSPlat/CommonPage/Error.aspx?aspxerrorpath=/etacp/Business/pub/webpub/PUb_Online/PUB_Online_Test.aspx" [MsgId: MMSG-26659]
Action.c(52): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://test5/etacp/BSPlat/CommonPage/css/css.css"
Action.c(70): Error -27979: Requested form not found [MsgId: MERR-27979]
Action.c(70): web_submit_form("PUB_Online_Test.aspx_2") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
作者: 鹭岛 时间: 2011-8-18 21:34
420204198008126554
5ccf62c2-bc51-4c31-9ee2-3f293e6e53c0
搞不好需要关联,你注意看看,多录制两次比较下
作者: msnshow 时间: 2011-8-18 21:35
打开display窗口看具体是哪步错了
作者: zengli80 时间: 2011-8-18 21:43
display窗口是哪个窗口?在哪啊?
作者: zengli80 时间: 2011-8-24 21:16
搞了几天,没解决问题,哪位高手指点一二啊
作者: 葺卡儿 时间: 2011-8-25 09:39
看了你提供的脚本代码,报错的是“web_submit_form("PUB_Online_Test.aspx_2")”。
其中包含了两个图片的申请,如果说此函数只是向服务器申请图片的URL路径,如果与楼主所关注的事务或测试目标无紧密联系,个人认为可以注释。如果是提交两张图片至服务器,则有可能存在需要关联的数据。
本人经验尚浅,还需楼主斟酌考虑。
作者: 放任无奈 时间: 2011-8-25 11:05
给lz几个建议
一是脚本的编写规范
一定要定义清楚各个事务你流程中的每一个操作都应该是一个事务
不要把所有的脚本都堆在一起 录完啥样就啥样
二是每个事务要有明确的检查点
你如何判断某个操作是否成功?
如果前面几步就失败了 后面执行还有意义么
(不要认为执行脚本不报错就是成功)
做到上面的两步
最起码哪里出了问题是很容易判断的了
另外一些tips
首先是关联
经验不足时
建议把脚本录制两边(完全一样的操作)
对比脚本
把不同之处做关联
参数化及日志的输出
每个vuser每次迭代使用一些unique参数
并做日志输出
这样 场景运行失败时可以定位到具体某一次迭代的某个vuser
作者: dajuanjuan87 时间: 2011-8-26 09:47
顶3楼,觉得是关联的问题。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |