|
通过各个下拉框的值及输入值,生成一个编号.该编号存在内存中.最后保存编号及部分下拉框的值及输入值到数据库.
录制脚本后,提交的数据都是页面中下拉框及输入的值,没有提交生成的编号.
如果在提交数据前做关联,保存该生成的编号.可在后面提交的数据中,并没有使用该参数.
回放脚本能成功,但记录写不进数据库.该如何解决呢?
部分脚本如下:
"保存"事务中,是各个下拉框的值及一些输入值.
lr_start_transaction("产生编号");
web_submit_form("ProjectInput.aspx_3",
"Snapshot=t5.inf",
ITEMDATA,
"Name=drplst_WorkCompany", "Value=电缆工程公司", ENDITEM,
"Name=drplst_ProjectSource", "Value=工程建设部", ENDITEM,
"Name=drplst_ProjectInvestor", "Value=城网工程", ENDITEM,
"Name=drplst_WorkArea", "Value=市区", ENDITEM,
"Name=drplst_ProjectSpecialty", "Value=电缆", ENDITEM,
"Name=txt_AccredNO", "Value=NEW001", ENDITEM,
"Name=dtp_AccredInputDate$dateTextBox", "Value={wtdata}", ENDITEM,
"Name=drplst_Operator", "Value=yusuanyuan01", ENDITEM,
"Name=chk_IfBorrow", "Value=on", ENDITEM,
"Name=chk_IfAuditing", "Value=<OFF>", ENDITEM,
"Name=chk_IfDesign", "Value=<OFF>", ENDITEM,
"Name=chk_IfSupervise", "Value=<OFF>", ENDITEM,
"Name=txt_BorrowID", "Value=borrow001", ENDITEM,
"Name=dtp_BorrowDate$dateTextBox", "Value={jldata}", ENDITEM,
"Name=txt_BorrowPerson", "Value=1", ENDITEM,
"Name=txt_BorrowWarrantor", "Value=1", ENDITEM,
"Name=txt_BorrowSanctifier", "Value=1", ENDITEM,
"Name=txt_BorrowReason", "Value=1", ENDITEM,
"Name=btn_Comfirm", "Value=", ENDITEM,
EXTRARES,
"Url=../styles/CommonInput.htc", "Referer=", ENDITEM,
"Url=../images/b017.gif", ENDITEM,
"Url=../images/15.gif", ENDITEM,
"Url=../images/btn.gif", ENDITEM,
LAST);
lr_end_transaction("产生编号", LR_AUTO);
/*
* 提交数据.
*/
lr_start_transaction("保存");
web_submit_form("ProjectInput.aspx_4",
"Snapshot=t6.inf",
ITEMDATA,
"Name=drplst_WorkCompany", "Value=电缆工程公司", ENDITEM,
"Name=drplst_ProjectSource", "Value=工程建设部", ENDITEM,
"Name=drplst_ProjectInvestor", "Value=城网工程", ENDITEM,
"Name=drplst_WorkArea", "Value=市区", ENDITEM,
"Name=drplst_ProjectSpecialty", "Value=电缆", ENDITEM,
"Name=txt_AccredNO", "Value=NEW001", ENDITEM,
"Name=dtp_AccredInputDate$dateTextBox", "Value={wtdata}", ENDITEM,
"Name=drplst_Operator", "Value=yusuanyuan01", ENDITEM,
"Name=chk_IfBorrow", "Value=<OFF>", ENDITEM,
"Name=chk_IfAuditing", "Value=<OFF>", ENDITEM,
"Name=chk_IfDesign", "Value=<OFF>", ENDITEM,
"Name=chk_IfSupervise", "Value=<OFF>", ENDITEM,
"Name=txt_BorrowID", "Value=borrow001", ENDITEM,
"Name=dtp_BorrowDate$dateTextBox", "Value={jldata}", ENDITEM,
"Name=txt_BorrowPerson", "Value=1", ENDITEM,
"Name=txt_BorrowWarrantor", "Value=1", ENDITEM,
"Name=txt_BorrowSanctifier", "Value=1", ENDITEM,
"Name=txt_BorrowReason", "Value=1", ENDITEM,
"Name=btn_Save", "Value=开 始", ENDITEM,
LAST);
web_url("WorkTable.aspx",
"URL=http://172.23.163.182/GCGL/Main/WorkTable.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.23.163.182/GCGL/main/main.aspx",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
lr_end_transaction("保存", LR_AUTO);
return 0; |
|