请教URL字符串中当前时间转换问题
情景:即时聊天系统,模拟客户端给客服发送消息,因消息延时,想把当前时间与消息一起发送至客服端。录制脚本发送“HELLO”的代码为:
web_url("msgManager.jsp_3",
"URL=http://192.168.1.123:8080/msgManager.jsp?msg=HELLO&vid=1251861781156&a=2&&toid=admin@123",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.123:8080/webTalkWindow.jsp?a=0&vid={Pid}&toid=admin@123&lancode=&frmurl=192.168.1.123:8080/index3.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
将对话框ID与时间参数化并转化到URL为:
web_url("msgManager.jsp_3",
"URL=http://222.247.55.130:8088/msgManager.jsp?a=2&vid={Pid}&toid=shirely&msg=%s",lr_eval_string("{Date}"),
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.123:8080/webTalkWindow.jsp?a=0&vid={Pid}&toid=admin@123&lancode=&frmurl=192.168.1.123:8080/index3.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
回放脚本时提示如下错误:
Action.c(110): 错误 -27226: “2009-9-2 20:43:10”参数(编号 3)无法识别或拼写不正确 "URL=http://222.247.55.130:8088/msgManager.jsp?a=2&vid={Pid}&toid=shirely&msg=%s",lr_eval_string("{Date}"),
先把日期取下来
lr_save_datetime("%Y-%m-%d %H:%M:%S",DATE_NOW,"today");
然后把上面的代码改为
"URL=http://222.247.55.130:8088/msgManager.jsp?a=2&vid={Pid}&toid=shirely&msg={Date}"
页:
[1]