友善交流技术...

发布新日志

  • QTP功能自动化测试

    2008-04-01 17:41:36

    QTP功能自动化测试,一直一来自己都用手来测试,现在有了这个玩意,真爽.
  • LR 8.0 卸载后装LR8.1出现lience 报错的解决办法

    2008-04-01 16:31:29

     其实很简单的. LR有自带的LIENCE :
       TEMPORARY 你只要输入这个就可以顺利的安装上的. 只不过只可以用25天的. 你要破解的,至于破解的方法,网上很多的.

     
  • 响应时间与页面下载时间的关系

    2008-04-01 16:21:35

    1. 场景: 我设置个事务:事务1, 事务2
    2. 事务1:事务响应时间为: 1.114s  
        但是:分面下载时间细分中: client time + server time + network time + receive time + first buffer time + dns time +connection time
                              0.003+0.007+0.163+0.003+0.17+0.269+0.166=0.781s
       这为什么这个时间会小于事务的时间呢? 真是弄不明白这个是为什么?

       欢迎大家一起来谈论下?
  • linux 抓取网络数据报

    2008-02-21 23:08:18

    在linux系统如何抓取数据包进行分析
    2630

    问题
    在linux系统如何抓取数据包进行分析

    解决方案
    linux上有两种比较好的抓包工具:ethereal和tcpdump

    对于ethereal,有图形界面和字符界面两种方式。
    到linux系统上执行rpm -qa | grep ethereal-gnome可查看是否安装了图形版本
    但是如果服务器上没有xwin图形环境,那么就只能用字符界面了

    命令:tethereal
    可选参数:-V、-f

    如果只执行tethereal,那么将只抓取数据包的包头,不显示里边的内容。加上-V参数后,即可显示内容。
    -f 参数用于过滤,默认情况下将抓取tcp和udp所有协议。

    如果想抓取UDP数据包并显示内容,则执行tethereal -V -f udp 即可
    另外还可以配合grep命令提取需要的关键内容

    tcudump命令是另外一个有用的工具,只能在字符下使用,

    tcpdump -n -nn -vv -XX -tttt -c 10 -e
    参数:
    -n:数字端口
    -nn:数字地址
    -vv:输出详细信息
    -c:抓取包的数量
    -e:打印以太网报头信息
    -i:选择适配器
  • linux 抓取数据报

    2008-02-21 23:06:00

    在目标机上来写一些脚本来显标MEM、CPU、DiskIO
    MEM数据的抓取脚本:
    [root@wy1 root]# cat mfree.sh
    #!/bin/sh
    /usr/bin/free -m | grep Mem |awk '{print $4}'
    /usr/bin/free -m | grep Mem |awk '{print $2}'
    [root@wy1 root]# sh mfree.sh (上面一个数据是内存使用量,下面的是内存总量,M)
    442
    1006
    CPU数据的抓取脚本
    [root@wy1 root]# cat cpustat.sh
    #!/bin/sh
    idle=`sar -u 1 3 | grep Average | awk '{print $6}'`
    used=`echo "101 - $idle" | bc -l -s`
    echo $used
    echo $idle
    DiskIO数据的抓取脚本
    [root@wy1 root]# cat iostat.sh (显示硬盘IO,k/s)
    #!/bin/sh
    used1=`sar -d 1 3 | tail -1 | awk '{print $4}'`
    used2=`echo "$used1 / 2" | bc -l`
    echo $used2
    echo $used2
  • 关于时间与事务时间的问题

    2008-02-03 14:47:01

    //下面是一个用LR来写的时间函数,自己感觉可以当事务时间的统计来使用.

    double E_time;

    merc_timer_handle_t S_time;
    double Avg_time=0;
    double Sum_time=0;
    int i=0;
    Action()
    {
      
     for(i=1;i<=10;i++)
      { 
      S_time=lr_start_timer();

          web_url("url","url=http://www.baidu.com",LAST);
     
          E_time=lr_end_timer(S_time);
          Sum_time=Sum_time+E_time;
       }
          Avg_time=Sum_time/10;
      lr_error_message("%lf",Avg_time);
     
      return 0;
    }
    //这个时间我们可以自己设定,自己感觉10就可以的,求出平均值便是一个很好的办法.

  • 关于LR中分隔字符串的操作

    2008-02-03 14:34:52

    好久以前为了找这个代码自己可是费尽了心思..但是现在终于找了,真的很高兴..与大家一起共享

     
         char path[] = "i love you ";
         char separators[] = " ";
         char *token;

         token = (char *)strtok(path, separators); /* Get the first token */

         if(!token) {

              lr_output_message("No tokens found in string!");
              return( -1 );
               }

         while( token != NULL ) { /* While valid tokens are returned */

             lr_error_message(token);
              token = (char *)strtok(NULL, separators); /* Get the next token */
             
     
                }
     // 本来想做工具测试,可是现在没有机会啊... 但愿有伯乐....

  • WEB页面的二级链接遍历

    2008-02-03 14:30:19

    //这个是二层所有的链接,遍历的代码...
    Action()
    {


       int i;
       int rc=0;
       int k=0;
       //  int sum=0;
       int sum1;
       int rc_new=0;
       int HttpRetCode=0;
       char temp[100];
       char child_temp[100];
       char New_url[100];
       char New_url2[100];

     

        lr_start_transaction("Big_datuu");
            web_reg_save_param("Datuu","LB=href=\"","RB=\"","ord=all");

      
             lr_start_sub_transaction("Child_datuu_1","Big_datuu");
             web_url("datuu","url=http://59.151.23.58/wapnew/info.do",LAST);
              lr_end_sub_transaction("Child_datuu_1",LR_AUTO);
       lr_end_transaction("Big_datuu",LR_AUTO);

       for(i=1;i<=atoi(lr_eval_string("{Datuu_count}"));i++)
          {
             sprintf(temp,"{Datuu_%d}",i);
             lr_save_string(lr_eval_string(temp),"stemp");
         
            
            rc=strstr(lr_eval_string("{stemp}"),"http");
              strcpy(New_url2,"");
     
               if(rc!=0)
                {
                  
                    web_reg_save_param("NewDa","LB=href=\"","RB=\"","ord=all");
                    web_url("Datuu_child","url={stemp}",LAST);
                                

                       HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);    //url 状态的判定。
               
                                   if(HttpRetCode==200)
                                          lr_message("ok this is the right url");
                                   else
                                          lr_error_message("sorry");  
                  
                  // lr_error_message("%s",lr_eval_string("{stemp}"));
                    for(k=1;k<=atoi(lr_eval_string("{NewDa_count}"));k++) 
                        {
                             sprintf(child_temp,"{Datuu_%d}",k);
                             lr_save_string(lr_eval_string(child_temp),"Nstemp");
                             rc_new=strstr(lr_eval_string("{Nstemp}"),"http");
                              strcpy(New_url,"");
                                   sum1=sum1+1;

                                if(rc_new!=0)
                                    {
                                      web_url("Datuu_child","url={Nstemp}",LAST);
                                   //   lr_error_message("%s",lr_eval_string("{Nstemp}"))
                                       sum1=sum1+1;
                                     }
                                else
                                    {
                                      strcat(New_url,"http:\/\/59.151.23.58");
                                      strcat(New_url,lr_eval_string("{Nstemp}"));

                                //     lr_error_message("%s",New_url);
                                     lr_save_string(New_url,"New_temp");
                                     web_url("New_url","url={New_temp}",LAST);
                                       sum1=sum1+1;
                                   
                                     
                                     }
                          }
                               
                    
                 }
                
                else
                 {
                //  lr_error_message("url is wrong");
              //     lr_error_message("%s",lr_eval_string("{stemp}"));
                     strcat(New_url2,"http:\/\/59.151.23.58");
                     strcat(New_url2,lr_eval_string("{stemp}"));

                    lr_save_string(New_url2,"New_temp2");
                     web_url("New_url","url={New_temp2}",LAST);
                        sum1=sum1+1;
                   
                  }          

                 }
       
         lr_error_message("%d",sum1);

     return 0;
     }
    //但是我想说明下,我用的WAP与WEB混合协议做的..

  • lr 中我用 endtime-starttime=sumtime ?

    2008-01-04 15:11:12

    我突然想到了一个获时间的方法?!不知道可行不!?

       #include "web_api.h"


       typedef long time_t;

    Action()
    {
        
     
           time_t NtimeS;
        time_t NtimeE;
           time_t NNow;

     web_url("www.baidu.com",
      "URL=http://www.baidu.com/",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t2.inf",
      "Mode=HTML",
      LAST);

     
        NtimeS=time(&NtimeS);
     //  lr_output_message("%d",time(&NtimeS));

     lr_start_transaction("搜索字符");

      
      web_submit_form("s",
      "Snapshot=t3.inf",
      ITEMDATA,
      "Name=wd", "Value=love", ENDITEM,
      LAST);

     

     web_url("s_2",
      "URL=http://www.baidu.com/s?wd=love&cl=3&tn=jkanh_pg",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t4.inf",
      "Mode=HTML",
      LAST);
         NtimeE=time(&NtimeE);

     web_url("getadv.php",
      "URL=http://client.webbrowser.smartpv.cn:1207/getadv.php?fid=7054&kid=3006&cnt=1&mac=00-1D-60-20-63-B4&kw=love&version=3.1.5",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t5.inf",
      "Mode=HTML",
      LAST);
       

     lr_end_transaction("搜索字符", LR_AUTO);

       
             NNow=NtimeE-NtimeS;

         // lr_output_message("%d",time(&NtimeS));
              lr_message("Formatted time and date: %d", NNow);
              lr_message("Formatted time and date: %s", ctime(&NtimeS));
              lr_message("Formatted time and date: %s", ctime(&NtimeE));     
          
      
      return 0;
    }

      这样和加入事务应该没有什么不同的,如果运行时间长的话,再求下平均值也不会差很多的!不知道我的想法对不?如果能从服务器那获取响应时间会更好的!

       

     

  • 是不是内存的泄漏问题

    2007-12-27 20:53:50

    1.今天做WEB测试时,在打开IE时,给我一个这样的提示:

     stack overflow at line 200.

      什么意思?!可能是死循环或是资源不充,或是内存的泄漏呢!?不明白,它只出现一次,今天怎么测试再不骨出现过这种情况!有点害羞了!死活不出来了!

      苦于没有内存测试工具啊!!

     

  • 测试感想

    2007-12-26 18:54:29

    测试的感觉

    1.需求要重视:

       我在一家公司,去的第一个月就接受到一个项目,谁也不敢想那么小的一个程序,你猜怎么着,我们测试了几版.说出来怕吓到你.共有7版,还说什么小程序,时间紧啊,没有时间来评审SRS.但是结果呢!? 

     不说我们和需求那边沟通,就是需求那边和开发的理解就有天壤之别,所以设计的东西,就不是我们要测试的东西!?开发和需求及确认至少要3天的时间,而我们和需求的确认也要3天左右的时间,你说这时间不是白白的浪费掉了吗!?

       如果大家在一起讨论一下需求,至于这样吗!?天天都要问需求,只是麻烦啊.我们还不可以直接问,要通过和主管沟通过才可以和需求那边来沟通..真不知道,这是谁弄的规定啊..

      现在一个项目说要2周完成,结果呢!? 三周啊..整整三周的时间的.开发那边是天天加班!我们呢,也就像跟屁虫一样,天天跟着开发走,这还要不要人活了.

       天天10左右才可以回家,你说这么小的项目,都弄成这个样子,真是不敢让人想像啊.. 他们以前是怎么工作的.

       我现在有一点麻木了!!

      已经不想再说什么了,所以天天只有莽的天混地暗的。

        悲哉!!

       

1719/9<123456789
Open Toolbar