51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2432|回复: 6
打印 上一主题 下一主题

[原创] LR参数化取值成功,但是数据无法入库

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-3-31 14:36:30 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
LR参数化取值成功,但是数据无法入库,好像根本没法触发 submit
这个是不是关联的问题呢?该怎么做关联?
俺是新手请高手帮忙
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

7#
 楼主| 发表于 2010-4-2 13:59:39 | 只看该作者

问题已经解决

web_reg_save_param("ViewState18",
                "LB/IC=ViewState\" value=\"",
                "RB/IC=\"",
                "Ord=1",
                "Search=Body",
                "RelFrameId=1",
                LAST);
谢谢放任无奈的指导
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2010-3-31 19:06:06 | 只看该作者
原帖由 wangsufang122 于 2010-3-31 15:18 发表
录制两个同样的脚本是指一个是录制提交数据的原脚本,一个是我改了参数的脚本吗?


不是 做手动关联时
要求你录制两个完全一样的脚本
包括你的输入
这样才能找出需要关联的变量

然后才到你做参数列表的时候
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2010-3-31 15:18:19 | 只看该作者

回复 3# 的帖子

录制两个同样的脚本是指一个是录制提交数据的原脚本,一个是我改了参数的脚本吗?
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2010-3-31 15:16:47 | 只看该作者
不太明白先试试再说吧

[ 本帖最后由 wangsufang122 于 2010-3-31 15:18 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2010-3-31 14:56:10 | 只看该作者
应该是关联的问题
很多页面(比如进入添加页面时)
SERVER会返回一个一个ID

如果你每次都用这一个ID去提交时会失败的
建议方法是
先录制两个同样的脚本
然后用WDIFF工具进行对比再关联
回复 支持 反对

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2010-3-31 14:40:56 | 只看该作者

回复 1# 的帖子

web_submit_data("VehicleBookingCreate.aspx_3",
                "Action=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookingCreate.aspx",
                "Method=POST",
                "RecContentType=text/plain",
                "Referer=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookings.aspx",
                "Snapshot=t9.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=ctl00$cphTitle$ScriptManager1", "Value=ctl00$cphTitleBody$UpdatePanel1|ctl00$cphTitleBody$ddlPurposeOfJourney", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MYP_PN_Month", "Value=3", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MYP_PN_Year", "Value=2010", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_SelDate", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MonthView", "Value=2010|3", ENDITEM,
                "Name=ctl00$Header1$ddlUserRoles", "Value=13", ENDITEM,
                "Name=ctl00$Header1$AssignedCompany$ddlDepartments", "Value=48", ENDITEM,
                "Name=ctl00$cphTitleBody$rblBookingTypes", "Value=B", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlTypeOfVehicleReuired", "Value=0", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlCylinderNumber", "Value=-1", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlTransmissionType", "Value=Any", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart", "Value=31/03/2010", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlStartHour", "Value=18", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlStartMinute", "Value=00", ENDITEM,
                "Name=ctl00$cphTitleBody$dateEnd", "Value=31/03/2010", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlEndHour", "Value=19", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlEndMinute", "Value=00", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlPickUpLocation", "Value=77", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlDestination", "Value={destination}", ENDITEM,
                "Name=ctl00$cphTitleBody$txtEstimatedTravelDistance", "Value={Distance}", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlPurposeOfJourney", "Value={Purpose}", ENDITEM,
                "Name=ctl00$cphTitleBody$ScheduleType", "Value=rbtnNo", ENDITEM,
                "Name=ctl00$cphTitleBody$txt1", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlAuthorizingOfficer", "Value=18816", ENDITEM,
                "Name=ctl00$cphTitleBody$chkShowAllAuthorzingOfficer", "Value=on", ENDITEM,
                "Name=ctl00$cphTitleBody$txtDriver", "Value=merry", ENDITEM,
                "Name=ctl00$cphTitleBody$txtAccountCode", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetPhone$txtPhone", "Value=11111111", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetMobile$txtPhone", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetEmail$txtPhone", "Value=sss@sss.com", ENDITEM,
                "Name=ctl00$cphTitleBody$txtLicence", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$txtExpiryDate", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$txtComments", "Value=", ENDITEM,
                "Name=__EVENTTARGET", "Value=ctl00$cphTitleBody$ddlPurposeOfJourney", ENDITEM,
                "Name=__EVENTARGUMENT", "Value=", ENDITEM,
                "Name=__LASTFOCUS", "Value=", ENDITEM,
                "Name=__VIEWSTATE", "Value=/wEPaA8FDzhjYzlmMGI0ZmNmZDMxMBgCBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WBAUXY3RsMDAkSGVhZGVyMSRpR29Ub01haW4FGmN0bDAwJGNwaFRpdGxlQm9keSRyYnRuWWVzBRpjdGwwMCRjcGhUaXRsZUJvZHkkcmJ0blllcwUZY3RsMDAkY3BoVGl0bGVCb2R5JHJidG5ObwUwY3RsMDAkY3BoVGl0bGVCb2R5JGd2Qm9va2luZ1dpdGhTcGVjaWFsRXF1aXBtZW50D2dk6ukwQt8UWUwnb3MUrh6mqDD1aOM=", ENDITEM,
                "Name=hideEnableShowSubmiting", "Value=false", ENDITEM,
                "Name=__ASYNCPOST", "Value=true", ENDITEM,
                LAST);

        /* Registering parameter(s) from source task id 101
        // {Siebel_Analytic_ViewState12} = "/wEPaA8FDzhjYzlmMGI3MDllZGY1MBgCBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUXY3RsMDAkSGVhZGVyMSRpR29Ub01haW4FJmN0bDAwJGNwaFRpdGxlQm9keSRndkJvb2tpbmdBY3Rpb25MaXN0DxQrAApkZGRkZGQVARBWZWhpY2xlQm9va2luZ0lEFCsAARQrAAEFBjI5NzE3OQIBFCsAAQUGMjk3MTc5ZInngzSQc/76j1duJoIHttlUWpkB"
        // */

        web_reg_save_param("Siebel_Analytic_ViewState12",
                "LB/IC=ViewState\" value=\"",
                "RB/IC=\"",
                "Ord=1",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        lr_think_time(18);

        web_submit_data("VehicleBookingCreate.aspx_4",
                "Action=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookingCreate.aspx",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookings.aspx",
                "Snapshot=t10.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MYP_PN_Month", "Value=3", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MYP_PN_Year", "Value=2010", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_SelDate", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart_PU_PN_MonthView", "Value=2010|3", ENDITEM,
                "Name=ctl00$Header1$ddlUserRoles", "Value=13", ENDITEM,
                "Name=ctl00$Header1$AssignedCompany$ddlDepartments", "Value=48", ENDITEM,
                "Name=ctl00$cphTitleBody$rblBookingTypes", "Value=B", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlTypeOfVehicleReuired", "Value=0", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlCylinderNumber", "Value=-1", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlTransmissionType", "Value=Any", ENDITEM,
                "Name=ctl00$cphTitleBody$dateStart", "Value=31/03/2010", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlStartHour", "Value=18", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlStartMinute", "Value=00", ENDITEM,
                "Name=ctl00$cphTitleBody$dateEnd", "Value=31/03/2010", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlEndHour", "Value=19", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlEndMinute", "Value=00", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlPickUpLocation", "Value=77", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlDestination", "Value={destination}", ENDITEM,
                "Name=ctl00$cphTitleBody$txtEstimatedTravelDistance", "Value={Distance}", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlPurposeOfJourney", "Value={Purpose}", ENDITEM,
                "Name=ctl00$cphTitleBody$ScheduleType", "Value=rbtnNo", ENDITEM,
                "Name=ctl00$cphTitleBody$txt1", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$ddlAuthorizingOfficer", "Value=18816", ENDITEM,
                "Name=ctl00$cphTitleBody$txtDriver", "Value=merry", ENDITEM,
                "Name=ctl00$cphTitleBody$txtAccountCode", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetPhone$txtPhone", "Value=11111111", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetMobile$txtPhone", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$WebfleetEmail$txtPhone", "Value=sss@sss.com", ENDITEM,
                "Name=ctl00$cphTitleBody$txtLicence", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$txtExpiryDate", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$txtComments", "Value=", ENDITEM,
                "Name=ctl00$cphTitleBody$btnSave", "Value=Submit", ENDITEM,
                "Name=__EVENTTARGET", "Value=", ENDITEM,
                "Name=__EVENTARGUMENT", "Value=", ENDITEM,
                "Name=__LASTFOCUS", "Value=", ENDITEM,
                "Name=__VIEWSTATE", "Value=/wEPaA8FDzhjYzlmMGI1MmQ3YmJlMBgCBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WBAUXY3RsMDAkSGVhZGVyMSRpR29Ub01haW4FGmN0bDAwJGNwaFRpdGxlQm9keSRyYnRuWWVzBRpjdGwwMCRjcGhUaXRsZUJvZHkkcmJ0blllcwUZY3RsMDAkY3BoVGl0bGVCb2R5JHJidG5ObwUwY3RsMDAkY3BoVGl0bGVCb2R5JGd2Qm9va2luZ1dpdGhTcGVjaWFsRXF1aXBtZW50D2dkpeE4+9gesTAKfJ1jxZ28BtklZEg=", ENDITEM,
                "Name=hideEnableShowSubmiting", "Value=false", ENDITEM,
                LAST);

        lr_end_transaction("submitbooking",LR_AUTO);

        lr_start_transaction("logout");

        web_submit_data("VehicleBookingActionResult.aspx",
                "Action=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookingActionResult.aspx",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://chinatestserver:83/ASPX/VehicleBooking/Booking/VehicleBookingCreate.aspx",
                "Snapshot=t11.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=hideEnableShowSubmiting", "Value=false", ENDITEM,
                "Name=__EVENTTARGET", "Value=ctl00$Header1$btLogout", ENDITEM,
                "Name=__EVENTARGUMENT", "Value=", ENDITEM,
                "Name=__LASTFOCUS", "Value=", ENDITEM,
                "Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState12}", ENDITEM,
                "Name=ctl00$Header1$ddlUserRoles", "Value=13", ENDITEM,
                "Name=ctl00$Header1$AssignedCompany$ddlDepartments", "Value=48", ENDITEM,
                LAST);

        lr_end_transaction("logout",LR_AUTO);

lr_output_message("The current destination is %s",lr_eval_string("{destination}"));
lr_output_message("The current Distance is %s",lr_eval_string("{Distance}"));
lr_output_message("The current Purpose is %s",lr_eval_string("{Purpose}"));

        return 0;
}
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-17 02:34 , Processed in 0.070611 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表