Action()
{
char *keyword;
char tempStr[50];
int i;
int length;
int time;
i=0;
length=0;
keyword = "LoadRunner"; //LoadRunner需要被参数化
lr_save_string(keyword,"param_keyword");
web_url("www.baidu.com",
"URL=http://www.baidu.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/img/i2.png", ENDITEM,
"Url=/img/arr.gif", ENDITEM,
"Url=/js/bdsug.js?v=1.0.3.0", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=L&p=3&cb=window.bdsug.sug&t=1302791328125", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=Lo&p=3&cb=window.bdsug.sug&t=1302791328359", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=Loa&p=3&cb=window.bdsug.sug&t=1302791328687", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=Load&p=3&cb=window.bdsug.sug&t=1302791328828", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadR&p=3&cb=window.bdsug.sug&t=1302791329968", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadRu&p=3&cb=window.bdsug.sug&t=1302791330328", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadRun&p=3&cb=window.bdsug.sug&t=1302791330562", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadRunn&p=3&cb=window.bdsug.sug&t=1302791330812", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadRunne&p=3&cb=window.bdsug.sug&t=1302791331046", ENDITEM,
//"Url=http://suggestion.baidu.com/su?wd=LoadRunner&p=3&cb=window.bdsug.sug&t=1302791331265", ENDITEM,
LAST);
length = strlen(lr_eval_string("{param_keyword}"));
lr_output_message("%d",length);
time = 1302791331265;
for(i=0;i<length;i++)
{
strncpy(tempStr,lr_eval_string("{param_keyword}"),i+1);
lr_output_message(tempStr);
lr_save_string(tempStr,"tmp_keyword");
time = time + 100;
lr_save_int(time,"param_time");
web_url("suggestion",
"URL=http://suggestion.baidu.com/su?wd={tmp_keyword}&p=3&cb=window.bdsug.sug&t={param_time}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
}
lr_think_time(7);
web_url("s",
"URL=http://www.baidu.com/s?wd={param_keyword}",
//"Snapshot=t2.inf",
//ITEMDATA,
//"Name=wd", "Value={param_keyword}", ENDITEM,
EXTRARES,
"Url=http://sclick.baidu.com/w.gif?q={param_keyword}&fm=se&T=1302791347&y=F7B49FF8&&cid=4&qid=abd7789a0badfccb&t={param_time}&path=http://www.baidu.com/s?wd={param_keyword}",
"Referer=http://www.baidu.com/s?wd={param_keyword}",
ENDITEM,
LAST);
return 0;
}