|
我定义了一个变量userName,目的是参数化web_submit_form函数中的username参数的值,可是为什么每次回放页面中输入的都是:{userName},(我启动了回放显示Browser功能)
请问LR中是否有函数或方法实现我说的这种问题,谢谢
Register_act()
{
char *userName;
userName="name091902"
web_url("mercuryWebTours", //打开首页
"URL=http://127.0.0.1:1080/mercuryWebTours",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
//lr_think_time(7);
lr_message("UserName=========%s",userName);
web_link("sign up now", //首页中,点击Register链接,打开注册页面
"Text=sign up now",
"Snapshot=t2.inf",
LAST);
//lr_think_time(107);
web_reg_find("Text={userName}", //添加文本检查点,检查成功提示界面中是否显示注册名
"Search=body",
LAST);
web_submit_form("login.pl", //提交注册信息,返回成功注册提示页面,并点击Continue按钮
"Snapshot=t3.inf",
ITEMDATA,
"Name=username", "Value={userName}", ENDITEM, //此处就会出现问题
"Name=password", "Value=111111", ENDITEM,
"Name=passwordConfirm", "Value=111111", ENDITEM,
"Name=firstName", "Value=first", ENDITEM,
"Name=lastName", "Value=second", ENDITEM,
"Name=address1", "Value=No.5, Beijing", ENDITEM,
"Name=address2", "Value=100086", ENDITEM,
"Name=register.x", "Value=37", ENDITEM,
"Name=register.y", "Value=6", ENDITEM,
LAST);
//lr_think_time(5);
web_image("button_next.gif", //登录系统
"Src=/MercuryWebTours/images/button_next.gif",
"Snapshot=t4.inf",
LAST);
return 0;
}
Log:
Register_act.c (26): syntax error; found `{' expecting `)'
Register_act.c (26): syntax error; found `{' expecting `;'
Register_act.c (26): syntax error; found `}' expecting `;'
Register_act.c (28): syntax error; found `)' expecting `;'
解决方法:
char *name;
name="name091902"
lr_save_string(name,"userName");//要用该方法保存
[ 本帖最后由 看雪时节 于 2008-9-22 14:13 编辑 ] |
|