51Testing软件测试论坛
标题:
字符集的选择
[打印本页]
作者:
jiachang
时间:
2010-10-15 17:11
标题:
字符集的选择
utf-8模式录制的脚本有关联,但部分汉字是乱码
不选择字符集录制的脚本没有乱码,没有关联,但有添加操作的的不成功。
这是字符集的原因吧,到底该选择哪种字符集,同时下边的两个问题怎么解决,望知情者提供信息,不胜感激!
utf-8录制的添加脚本,有乱码,回放也不成功,提示找不到“?”即乱码部分
Action()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 7
// {Siebel_Analytic_ViewState2} = "/wEPDwULLTE5MzA2NTM1MDFkZMhW7tsMnr72dyQw1EWe9oRnEdQl"
// */
web_reg_save_param("Siebel_Analytic_ViewState2",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
web_url("Login.aspx",
"URL=http://10.1.16.89/libraryMS/Login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_submit_data("Login.aspx_2",
"Action=http://10.1.16.89/libraryMS/Login.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.1.16.89/libraryMS/Login.aspx",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState2}", ENDITEM,
"Name=txtAdmin", "Value=tsoft", ENDITEM,
"Name=txtPwd", "Value=111", ENDITEM,
"Name=txtCode", "Value=", ENDITEM,
"Name=btnLogin", "Value=登录", ENDITEM,
"Name=__EVENTVALIDATION", "Value=/wEWBgLH06DZCwKN8+WYBgKd+7qdDgLChPzDDQKC3IeGDAKQ9M/rBTMz5cP3aLfsQzbX86Jne1ixRdMJ", ENDITEM,
EXTRARES,
"Url=../LibraryMS/WebResource.axd?d=sQsZ8AfHHfX5j7Lh0K2vYg2&t=633936346575142915", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
"Url=../LibraryMS/WebResource.axd?d=kEe3vR9BO-LC5GNwMzINFw2&t=633936346575142915", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
"Url=images/index_02.gif", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
LAST);
web_link("?",
"Text=?",
"Ordinal=5",
"Snapshot=t3.inf",
EXTRARES,
"Url=../images/guanliyuanshezhi.gif", ENDITEM,
LAST);
/* Registering parameter(s) from source task id 40
// {Siebel_Analytic_ViewState6} = "/wEPDwULLTEzNTI5MDI0MTkPZBYCZg9kFgICAw9kFgYCAw8PFgIeBFRleHQFETIwMTDlubQxMOaciDE15pelZGQCBQ8PFgIfAAUJ5pif5pyf5LqUZGQCBw88KwANAQwUKwAKZGQUKwACFgIeB0VuYWJsZWRnZBQrAAIWAh8BZ2QUKwACFgIfAWdkFCsAAhYCHwFnZBQrAAIWAh8BZ2RkZGRkZBvIAakYWbPavvIch0fACrucZrSS"
// */
web_reg_save_param("Siebel_Analytic_ViewState6",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
web_link("??",
"Text=??",
"Ordinal=4",
"Snapshot=t4.inf",
EXTRARES,
"Url=../images/tianjiaguanliyuanxinxi.gif", ENDITEM,
LAST);
web_submit_data("AddAdmin.aspx",
"Action=http://10.1.16.89/libraryMS/SysSet/AddAdmin.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.1.16.89/libraryMS/SysSet/AddAdmin.aspx",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState6}", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtName", "Value=145", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtPwd", "Value=111", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtSPwd", "Value=111", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$btnAdd", "Value=添加", ENDITEM,
LAST);
return 0;
}
复制代码
没有选择字符集时的代码,登录成功,但添加不成功
Action()
{
web_url("Login.aspx",
"URL=http://10.1.16.89/libraryMS/Login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_reg_find ("search=body","Text=排名","SaveCount=排名_Count",LAST);
web_submit_form("Login.aspx_2",
"Snapshot=t2.inf",
ITEMDATA,
"Name=txtAdmin", "Value=tsoft", ENDITEM,
"Name=txtPwd", "Value=111", ENDITEM,
"Name=txtCode", "Value=", ENDITEM,
"Name=btnLogin", "Value=登录", ENDITEM,
EXTRARES,
"URL=../LibraryMS/WebResource.axd?d=sQsZ8AfHHfX5j7Lh0K2vYg2&t=633936346575142915", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
"URL=../LibraryMS/WebResource.axd?d=kEe3vR9BO-LC5GNwMzINFw2&t=633936346575142915", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
"URL=images/index_02.gif", "Referer=http://10.1.16.89/libraryMS/Default.aspx", ENDITEM,
LAST);
if (atoi(lr_eval_string("{排名_Count}")) > 0){ //判断如果Welcome字符串出现次数大于0
lr_output_message("Log on successful.");}
else{ //如果出现次数小于等于
lr_error_message("Log on failed"); //在日志中输出Log on failed
}
web_link("读者档案管理",
"Text=读者档案管理",
"Snapshot=t3.inf",
EXTRARES,
"URL=../images/duzhedanganguanli.gif", ENDITEM,
LAST);
web_link("添加读者信息",
"Text=添加读者信息",
"Snapshot=t4.inf",
EXTRARES,
"URL=../images/tianjiaxiugaiduzhexinxi.gif", ENDITEM,
LAST);
web_submit_form("AddReader.aspx",
"Snapshot=t5.inf",
ITEMDATA,
"Name=ctl00$ContentPlaceHolder1$txtReader", "Value=mmm", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$ddlSex", "Value=女", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$ddlRType", "Value=老师", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtBirthday", "Value=2001-10-13", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$ddlPaperType", "Value=身份证", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtPaperNum", "Value=112", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtTel", "Value=1212", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtEmail", "Value=12", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtDate", "Value=2010-10-13", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtOper", "Value=12", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$txtRemark", "Value=", ENDITEM,
"Name=ctl00$ContentPlaceHolder1$btnAdd", "Value=添加", ENDITEM,
LAST);
return 0;
}
复制代码
作者:
PrefTest
时间:
2010-10-15 17:32
http://www.cnblogs.com/preftest/archive/2010/08/02/1790569.html
#1
作者:
jiachang
时间:
2010-10-16 09:20
在IIS中找到Web.Config文件,在<system.web>….</system.web>节加入<globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312"/>后再次录制脚本,乱码变中文。
已经按照上面的设置修改过才出现上面选择字符集的问题。
作者:
jiachang
时间:
2010-10-18 10:05
没有选择字符集录制的脚本也没有关联
作者:
jiachang
时间:
2010-10-22 10:17
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2