51Testing软件测试论坛
标题:
请教,登录事务的结束点应该在哪里?多谢
[打印本页]
作者:
海上鸽子
时间:
2012-11-27 15:32
标题:
请教,登录事务的结束点应该在哪里?多谢
Action()
{
web_url("login", //打开登录的页面
"URL=http://www.smr/system/login/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
lr_think_time(10);
lr_rendezvous("login");
lr_start_transaction("login"); //事务开始
web_submit_form("index.html_2", //提交登录的用户信息表单
"Snapshot=t3.inf",
ITEMDATA,
"Name=ocUname", "Value={user}", ENDITEM,
"Name=ocPword", "Value={pswd}", ENDITEM,
"Name=ocOuSearch", "Value=Search organizational unit", ENDITEM,
LAST);
lr_end_transaction("login", LR_PASS);
//提交用户信息后就算登录事务的结束吗?
web_url("workplace.jsp", //加载登录成功后显示的首页信息
"URL=http://http://www.smr/system/workplace/views/workplace.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=/opencms/resources/buttons/publish_in.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/buttons/publish_queue.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/buttons/reload.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/buttons/preferences.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/buttons/help.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/buttons/logout.png", "Referer=http://http://www.smr/system/gin/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/commons/workplace.png", "Referer=http://http://www.smr/system/workplace/views/top_head.jsp?wpFrame=head", ENDITEM,
"Url=/opencms/resources/explorer/project_none.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/commons/explorer.css", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/filetypes/folder.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/filetypes/configfolder.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/filetypes/containerpage.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/filetypes/subsitemap.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/buttons/wizard_in.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/buttons/ex_search.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/buttons/back.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/buttons/upload_in.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/buttons/folder_up_in.png", "Referer=http://http://www.smr/system/workplace/views/explorer/explorer_files.jsp?mode=explorerview", ENDITEM,
"Url=/opencms/resources/tree/start.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/tree_files.jsp?resource=/", ENDITEM,
"Url=/opencms/resources/tree/upcross.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/tree_files.jsp?resource=/", ENDITEM,
"Url=/opencms/resources/tree/ufolder.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/tree_files.jsp?resource=/", ENDITEM,
"Url=/opencms/resources/tree/upend.gif", "Referer=http://http://www.smr/system/workplace/views/explorer/tree_files.jsp?resource=/", ENDITEM,
LAST);
lr_end_transaction("login", LR_PASS);
//还是登录成功后首页加载完成算登录事务的结束点呢?
web_find("web_find",
"What=Exit",
LAST);
return 0;
}
请教一个问题,上面的代码是录制一个浏览器页面的登录操作的脚本,现在我有个疑惑,登录这个操作的事物的结束点在哪里?
是提交用户登录信息的表单后就结束事务还是加载完登录成功后的首页呢?
可能问题很菜,但请帮忙解答,多谢。
作者:
海上鸽子
时间:
2012-11-27 15:33
补充:是模拟用户操作的登录事务,谢谢
作者:
海上鸽子
时间:
2012-11-27 20:28
求各位帮忙解答吧,谢谢
作者:
shigui3615
时间:
2012-11-27 21:33
看看这个
http://www.sdstc.net/plus/view.php?aid=523
个人觉得,应该放在提交事务函数的后面,因为“尽量是每个定义的事物符合逻辑和小”。
作者:
海上鸽子
时间:
2012-11-27 22:52
楼上的意思就是说是在web_submit_form()函数后面添加 lr_end_transaction()函数?
但是真实用户登录成功后,客户端会下载页面信息的,也就是web_url()这个函数,那如果在web_submit_form()函数后就结束事务的话响应时间会不会跟真实用户操作有很大的差距呢?
我对这个赶到疑惑,所以不知道该在哪里结束事务,请帮忙解释清楚点,谢谢
作者:
shigui3615
时间:
2012-11-27 23:16
我觉得,你只是测登录,只要web_submit_form()函数执行成功,就表明用户登录成功了,后面的那些是登录以后做的事,所以......
不知道其他朋友还有没有别的看法咯。
作者:
msnshow
时间:
2012-11-28 08:32
这个要看你对事务的定义是什么了
作者:
msnshow
时间:
2012-11-28 08:33
一般情况下我们会以网友完成这样一个操作定义为了一个事务,那么这里你就应该是在登陆结束后,包括返回结果页的加载
作者:
shigui3615
时间:
2012-12-1 11:05
学习了,谢谢
作者:
ffwithvv
时间:
2012-12-3 10:48
应该算上页面的加载时间吧,因为后来分析事物响应时间的时候,页面加载也是很重要的一部分
作者:
isummer1118
时间:
2012-12-3 11:55
我也觉得的应该放在加载的页面之后 不过有时候也要看需求的
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2