发布新日志

  • 转载:Apache自带性能测试工具ab的使用

    2009-04-20 14:49:03

    转载:Apache自带性能测试工具ab的使用:

    http://www.51testing.com/?uid-202848-action-viewspace-itemid-117467

    1 概述

      ab(ApacheBench)是Apache自带的超文本传输协议(HTTP)性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能, 主要是显示你安装的Apache每秒可以处理多少个请求。

    2.1 安装

      Apache服务器套件自带ab,只要安装Apache即可,无需另行安装ab。ab位于%ApacheHome%/bin目录下(“%ApacheHome%”为Aapche安装路径),你也可以把ab.exe文件copy出来,独立使用。

      2.2 参数列表

      C:\>ab

      ab: wrong number of arguments

      Usage: ab [options] [http://]hostname[:port]/path

      Options are:

      -n requests Number of requests to perform

      -c concurrency Number of multiple requests to make

      -t timelimit Seconds to max. wait for responses

      -p postfile File containing data to POST

      -T content-type Content-type header for POSTing

      -v verbosity How much troubleshooting info to print

      -w Print out results in HTML tables

      -i Use HEAD instead of GET

      -x attributes String to insert as table attributes

      -y attributes String to insert as tr attributes

      -z attributes String to insert as td or th attributes

      -C attribute Add cookie, eg. 'Apache=1234. (repeatable)

      -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'

      Inserted after all normal header lines. (repeatable)

      -A attribute Add Basic WWW Authentication, the attributes

      are a colon separated username and password.

      -P attribute Add Basic Proxy Authentication, the attributes

      are a colon separated username and password.

      -X proxy:port Proxyserver and port number to use

      -V Print version number and exit

      -k Use HTTP KeepAlive feature

      -d Do not show percentiles served table.

      -S Do not show confidence estimators and warnings.

      -g filename Output collected data to gnuplot format file.

      -e filename Output CSV file with percentages served

      -h Display usage information (this message)

  • 好书推荐:homebrew_test_automation

    2009-04-16 15:12:46

    好书推荐:homebrew_test_automation  by Bret Pettichord

    精彩片断:

    Test Automation Ingredients

    1. Language

    2. Interface Drivers

    3. Test Harnesses

    4. Remote Agents

    5. Test Parsers

    6. Test Generators

  • Difference between Action and Function

    2009-04-01 19:26:56

    QTP里面有Action和function,这2者有什么不同呢?在什么样的情况下选择用reusable action, 什么情况下用libray里面的function来对组织公用的方法及组件呢?

    首先:单纯从Action和Function的不同来说:

    1。 Action存有Local Objects,可以和shared object repository,shared library, Data Table, User-defined environment variable以及Recovery相关联。但function一般情况下只保存在libray file里面,本身不和object, Data Table, Environment variables 相关联。尤其是不能和object repository相关联,这就导致在用Function来管理一些对具体的objects有操作的一些组件的时候,需要同时为这个shared library file准备一个shared object repository。否则就有可能导致在function里面,对object的操作失败,找不到相应的object.

    2。 Action和Function都有input parameters和output parameters。但这之间仍然是有区别的。Function的input parameters和output parameters,因为VB script的关系,导致其只有一种类型,没有具体的parameter type。但Action不同,Action可以定义具体类型(string, number, boolean...)的input和output parameter。

    3。 保存一个Action,一般会同时保存很多文件,而function只需要一个.qfl文件即可。

    4。 在调用Action或者function的时候,function可以直接调用,action需要"Insert Call to Existing...",然后需要选定action的路径。虽然在expert view里面同样是一个语句,但如果仅仅手动输入这样一个"RunAction ....",是行不通的,必须要通过"Insert Call to Existing..."的方式加进去。

    所以总结上面的不同点,对于“什么情况下用libray里面的function来对组织公用的方法及组件呢?”这样的问题总结如下:

    1。 在Function里面尽量不要有关于object的具体操作。如果一定要有这样的function,那就必须管理相应的shared object repository。建议即使要用function来管理有关object的操作,可以用descriptive programming。

    2。 有关business的逻辑,最好用Reusable Action来保存。当然如果考虑到有太多这样可重用的Reuseable Action,而且不便保存太多Action的话,也可以用Function。

     

  • Difference between Function and Sub in VB Script

    2009-04-01 19:12:42

    转载:http://qtp9.blogspot.com/2008/11/difference-between-function-and-sub.html

    Sub Procedures
    Function Procedures
    Sub Procedures

    A sub procedure is a series of VBScript. statements, enclosed by Sub and End Sub statements which perform. actions but do not return a value. A sub procedure can take arguments. If a sub procedure doesn’t receive any arguments, its Sub statement must include an empty parenthesis().

    The following Sub procedure uses two intrinsic, or built-in, VBScript. functions, MsgBox and InputBox , to prompt a user for information. It then displays the results of a calculation based on that information. The calculation is performed in a Function procedure created using VBScript. The Function procedure is shown after the following discussion.

    Sub ConvertTemp()

    temp = InputBox("Please enter the temperature in degrees F.", 1)

    MsgBox "The temperature is " & Celsius(temp) & " degrees C."
    End Sub

    Function Procedures

    A function procedure is a series of VBScript. statements enclosed by the Function and End Function statements. A function procedure is similar to a sub procedure but it can return value to the calling function. A function procedure can take arguments (constants, variables or expressions that are passed to it by a calling procedure). If a function procedure has no arguments, it Function statement must include an empty set of parenthesis. A function returns a value by assigning a value to its name in one or more statements of the procedure. Since VBScript. has only one base data type, a function always returns a variant.

    In the following example, the Celsius function calculates degrees Celsius from degrees Fahrenheit. When the function is called from the ConvertTemp Sub procedure, a variable containing the argument value is passed to the function. The result of the calculation is returned to the calling procedure and displayed in a message box.

    Sub ConvertTemp()
    temp = InputBox("Please enter the temperature in degrees F.", 1)
    MsgBox "The temperature is " & Celsius(temp) & " degrees C."
    End Sub

    Function Celsius(fDegrees)
    Celsius = (fDegrees - 32) * 5 / 9
    End Function
    Tips:
    To get data out of a procedure, you must use a Function. Remember, a Function procedure can return a value; a Sub procedure can't.
    A Function in your code must always be used on the right side of a variable assignment or in an expression.
    To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma. The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.
    The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do exactly the same thing.
    Call MyProc(firstarg, secondarg)

    MyProc firstarg, secondarg

    Notice that the parentheses are omitted in the call when the Call statement isn't used.

  • 对QTP的小的总结(1)

    2009-01-18 00:04:51

    概括QTP几个关键点: Mercury company, GUI functional testing tool, Using VB scrīpt, mainly used in regression test, advanced keyword-driven.

    QTP的知识点:

    1. launch QTP and create first test. Launch QTP -> Select Add-in -> Be familiar with Keyword View and Export view, record and run -> Change actions properties(Input and out parameters/Associate repositories) -> Change test settings.

    2. Parametize. 1) action and test parameters. 2) Data table. 3)Environment parameters. 4) Randome parameters.

    3. Checkpoints. 1)Check Object property values. 2) Check tables. 3) Check Text. 4) Check Bitmaps. 5) Check XML.

    4. Objects. 1) How QTP identify objects. 2) TO and RO. 3) Object repository. 4) Change object desription properties value. 5) Configure Object identification.

    5. Descrīptive programming.

    6. Automate QTP.

    7. Automate Object repository.

  • 失败的面试经验

    2009-01-17 23:29:47

        前2天去面试了IBM,突然感觉自己这2年来很失败。有很多东西都没有总结,也有很多东西没有仔细学习。记下这失败的经验,但愿以后任何面试可以顺顺利利。

        现在想想为什么要进去那么早呢。提前到本来是好事,现在却变成了自我施压的时间。以后面试一定只提前5分钟到。他的问题是:

        1。 为什么来面试,上一个公司怎么了?

        2. 英文自我介绍+谈谈对自己的职业规划。

        3. QTP相关的东西。QTP是怎样的东西,怎样概括QTP? 还有是说到我们QTP frameworks. 其中一个问题是怎样定义reusable action和functions。这2着之间有什么区别?对Object repository的相关问题。有没有改过object descrīption properties,可不可以举个例子用正则表达式来修改object descrīption properties。

        4. 测试的基本功。举个例子怎样做test design,方法是什么? 怎样测电梯的控制程序?

        5. 你有些什么问题。

        现在想起来,这些问题本不是非常难。为什么当时没有很好的发挥出来呢?郁闷。怎样概括QTP,以前都有总结过,其实就是GUI functional testing tool, using VB scrīpt. 具体有哪些内容的话其实也就是: Objects(TO, RO and Object identifier), parameterize, checkpoints, descrīptive programming, automate QTP and object repository. 

        Reusable action和functions的区别: 1) reusable action本身作为action,可以associate object repository, 可以加resources files. 哎。。看来这里还是没有弄清楚。其实如果是调用reusable action和function,本质上来都是直接跑那些steps而已,如果是这样的话,那理论上funcitons也可以全部用reusable action来实现啊? 到底2者有什么区别?如果在一个framework中,这2中都希望用到的话,到底怎样定义那些写成reusable action,那些写成function呢?

        有关电梯测试: http://bbs.51testing.com/viewthread.php?tid=110214&highlight=%B5%E7%CC%DD%2B%B2%E2%CA%D4 

  • 关于测试用例和自动化的一些想法

    2008-11-23 20:42:40

    对于测试用例进行分级,比如:

    Priority0: 安装系统并起系统,可以正常的login等。

    Priority1: 系统的一些主要功能.

    Priority2: 模块的主要功能。

    Priority3: 模块的正常测试用例。

    对于P0,P1的测试实际上是对包的Acceptance Test,而P2可以做为每个模块的Smoke Test,P3则是对于系统全面的测试用例。

    而实际上在对每个release package来说,并不一定要做P3上面全面的回归测试,所以可以说P2的case才是最重要的。而这方面也是可以最先来实现自动化。而且对于P2和P3,实际上可以有个结果的重用。因为P2实际上是对P3 case的总结,所以P2的case总会包含P3的case。所以当测完P2case的时候,很多P3的case也被测过了。这中间可以建立一个从P2到P3case测试结果传递的文档。

    对于P3的case,因为有很大部分已经被P3的cases所覆盖,所以P3应当更注重于反面用例的测试。而且对于每个release package来说,我们可以将那些failed的case单独的抽取出来,在这个failed的case的基础上加更多的测试用例。而对于那些非常稳定的测试用例,我们则可以把那些逐渐的整合,合并,变成P2的case.

    所以理想的情况下,对于每个release package的测试将是:P0,P1和P2的case一定跑完,然后部分的测试P3的case。当然,如果可能,P1和P2的case都应当尽量的进行自动化。而作为对case的辅助,还可以进行ad hoc测试等。

     

  • 整理整理~

    2008-11-23 17:40:41

    今天看见朋友的博客,突然觉得有必要自己也总结点东西了。 或许现在太晚,但不管怎么说,总算开始有这个想法,总结点东西。

    希望以后也能坚持吧。坚持就是胜利~

Open Toolbar