51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1938|回复: 0
打印 上一主题 下一主题

[求助] 为什么关联函数,FOR循环只执行一次,第二次是NULL

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-9-4 15:28:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 allison913 于 2013-9-5 09:00 编辑

Action()
{
int count;
int i;
char param[8];
web_set_max_html_param_len("3333333");
web_reg_save_param_regexp(
  "ParamName=temp",
  "RegExp=<li>.*<em class=\"ntes-.*\">(.*).*</em></span></a></li>",
  "Ordinal=ALL",
  SEARCH_FILTERS,
  LAST);
web_url("网易博客",
  "URL=http://blog.163.com",
  "Resource=0",
  "Referer=",
  LAST);
count=atoi(lr_eval_string("{temp_count}"));
lr_output_message("%d",count);
if(atoi(lr_eval_string("{temp_count}"))==0)
{
  lr_output_message("there is no any id.");
}
else
  {
   for(i=1;i<count;i++)
    {
     sprintf(param,"{temp_%d}",i);
     lr_output_message("输出内容:%s\n",lr_save_string(lr_eval_string(param),"{temp}"));
    }
  }
return 0;
}

-------------------------------------------------------------------------------------------------
Action.c(13): Notify: Saving Parameter "temp_1 = 网易新闻".
Action.c(13): Notify: Saving Parameter "temp_2 = 网易云音乐".
Action.c(13): Notify: Saving Parameter "temp_3 = 网易云阅读".
Action.c(13): Notify: Saving Parameter "temp_4 = 有道云笔记".
Action.c(13): Notify: Saving Parameter "temp_5 = 网易花田".
Action.c(13): Notify: Saving Parameter "temp_6 = 网易公开课".
Action.c(13): Notify: Saving Parameter "temp_7 = 网易彩票".
Action.c(13): Found resource "http://img1.126.net/channel8734/014807/650100_0902_ttw.swf" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=column650x100&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/hy/20130701/yxin/x/300x100.gif" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=logo300x100&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img1.126.net/channel8/014012_960-100_0628.swf" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=column960x100&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/hy/20130701/yxin/x/960x100.gif" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=column960x100&location=2"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/game/20130901/dh2/300x250.jpg" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=logo300x250&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/yuehui/20130701/960X100.jpg" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=column960x100&location=3"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/vip/20130901/300x150.jpg" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=logo300x150&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://img2.126.net/xoimages/istyle/20130901/a/960x130.jpg" in HTML "http://g.163.com/r?site=netease&affiliate=blog&cat=homepage&type=column960x130&location=1"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://imgsize.ph.126.net/?enlarge=true&imgurl=http://imglf2.ph.126.net/ZSt6tKNzNeUGKyHb18XIaA==/1140255130755045602.jpg_260x226x1x90.jpg" in HTML "http://www.lofter.com/blogHomeEntry.do"   [MsgId: MMSG-26659]
Action.c(13): Found resource "http://imgsize.ph.126.net/?imgurl=http://img2.ph.126.net/7GVEHnPOZuKPszPEH-pymg==/1901081992803968873.jpg_64x64x0.jpg" in HTML "http://www.lofter.com/blogHomeEntry.do"   [MsgId: MMSG-26659]
Action.c(13): Notify: Saving Parameter "temp_count = 7".
Action.c(13): web_url("网易博客") was successful, 1800286 body bytes, 60220 header bytes, 96 chunking overhead bytes   [MsgId: MMSG-26385]
Action.c(18): Notify: Parameter Substitution: parameter "temp_count" =  "7"
Action.c(19): 7
Action.c(20): Notify: Parameter Substitution: parameter "temp_count" =  "7"
Action.c(29): Notify: Parameter Substitution: parameter "temp_1" =  "网易新闻"
Action.c(29): Notify: Saving Parameter "{temp} = 网易新闻".
Action.c(29): 输出内容:(null)
Ending action Action.
Ending iteration 1.
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-6 09:47 , Processed in 0.062573 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表