AutoIt vs QTP

本文对比了QTP和AutoIt两种自动化测试工具的特点。QTP界面友好,适合非程序员使用,而AutoIt更偏向开发者,支持屏幕快照、基本Windows控件识别等功能。QTP在对象识别、浏览器支持等方面更强,但AutoIt在脚本语言和GUI支持方面表现优秀。AutoIt为免费软件,而QTP成本较高。
               

有人比较了一下QTP和AutoIt:
http://www.autoitscript.com/forum/index.php?showtopic=66144


AutoIt and QTP are hard to compare but I 'll try since I just recently since about 4-6 weeks know AutoIT and QTP I know for about 2 years.

AutoIt的原本目的不是作为测试工具,但是确实具备自动化测试工具的主要组成部分。
AutoIT was not intended as a testing tool but definitely it has all components available to do automated testing but needs a little more studying.
If AutoIT recognizes your objects (not all are recognized with AU3Info tool but you can recognize more from script. HTML controls are not

recognized by AU3Info but can be controlled from functions as documented in IE.AU3 UDF library)

* QTP is more focused on the userlevel with a friendly userinterface also usable by non programmers. AutoIT is more for the script developer

and not for a tester although an experienced scripter can make life real friendly with GUI support which is contained within AutoIT language
QTP关注用户层,拥有友好的用户界面,即使不怎么懂开发的人也能使用。AutoIt则偏向于由开发者使用(用的是类似VBScript的AutoIt语言)


* QTP has a better spy on windows/objects out of the box. If you scan this forum there are many short scripts which help you out to spy on

other objects. AutoIT can do it but its not fully integrated within AU3Info tool (the spy equivalant of QTP). So easy spying on internet controls is

not easy
QTP的Object Spy要比AutoIt的AU3Info强很多。

* QTP expertview is comparable to the development way how AutoIT works (Installing the full Scite Installation package you have a full IDE)
QTP的专家视图用于脚本编辑,而AutoIt用的是Scite。

* QTP has better support for terminal emulator out of the box although with AutoIT you can build easily your own screenscraper
QTP对于终端模拟器的支持要强些。

* QTP has java support which is not available thru AutoIt (So far not found .au3 scripts that connect with Java Native Interface / JNI)
QTP有java支持,但是AutoIt暂时还没有找到连接JNI的.au3脚本。

* QTP has powerbuilder object support which is not available thru AutoIt (unless you workaround this with virtual area's to click on)
QTP支持Powerbuilder,而AutoIt不支持。

* QTP has a translation table (control repository) to give objects a logical and a technical name. Within AutoIT you have to define this lookup

functionality yourself.
QTP有对象库,AutoIt没有。

* QTP has support for different browsers whereas AutoIT can only do this by Active Accessibility (search in forum) or bitmap comparison.

AutoIT supports IE controls by using IE.AU3 or own COM object references.
QTP支持IE和FF,AutoIt可以通过IE.au3或COM接口支持IE的操纵。


AutoIt的一些特色:
Autoit supports
* Easy screen snapshots
* Recognizes all basic windows controls
* Can recognize areas with pixelchecksum and pixelsearch (comparable with virtual objects of QTP)
* Has an advanced programming language with a lot of user defined functions
* Can be controlled from VBScript if wanted (Don't feel you should but at least you can)
* Within Scite IDE you can
** compile, build, run your scripts
** build a custom GUI for your scripts which is hard in QTP where you can only do this with an HTML page logic
** easily record simple scripts
** syntaxcoloring of your AU3 code
* You can create small standalone executables

Own experience so far
* Good support in the forums
* Good manual/help where a lot of examples are demonstrating how functions work
* Takes a litlle reading in the help before you have your basic scripts running (Windows controls and IE controls (study functions of IE.AU3))
* You need to know what you are doing. QTP brings you further at first steps but so far with QTP the userview is only for starters but quickly

you will change to expertmode for coding a better maintainable testsuite.
* Debugging loglines with consolewritecommand and run your script from within Scite as an IDE

Advice to read
* http://www.autoitscript.com/autoit3/docs/faq.htm
* http://www.autoitscript.com/forum/index.php?showtopic=37289
* Study the help file
* Check this forum

AutoIT has my vote over QTP for projects / applications where the controls are recognized properly.
WinRunner I used for about 4-5 years and AutoIT wins easily on the scripting language and functions. TSL is from ancient history compared

with AutoIT language but also here WinRunner has more support for different controls (Powerbuilder, Siebel, Java, If you don't need that

AutoIT will be a better start).

AutoIt是免费的,而QTP要花很多“银子”
AutoIT is free where QTP cost(s) a lot of money, you should made the tradeoff if spending in the beginning a little more time on AutoIT will

save you money on the long run




下面是一个使用IE.au3的AutoIt脚本,用于WEB测试自动化,例如打开URL导航到指定页面,点击页面上的指定链接等:
#include <IE.au3>
$oIE = _IECreate ("http://blog.youkuaiyun.com/testing_is_believing/")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended

MsgBox(0, "Link Info", $iNumLinks & " links found")

For $oLink In $oLinks
   ;MsgBox(0, "Link Info", $oLink.href)
   If $oLink.href = "http://blog.youkuaiyun.com/Testing_is_believing/category/357781.aspx" Then
        $oLink.click
    ElseIf $oLink.href = "http://blog.youkuaiyun.com/Testing_is_believing/category/642324.aspx" Then
        $oLink.click
    EndIf
Next



其实,AutoIt和其他自动化测试工具可以很好地整合在一起!

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow

<think>嗯,用户想了解CRC32校验算法的实现和使用方法。我需要先回顾一下CRC32的基本原理,然后考虑如何用简单易懂的中文解释清楚。首先,CRC32是基于循环冗余校验的一种算法,主要用于检测数据传输或存储中的错误。用户可能希望知道它的具体步骤,比如如何初始化、处理数据、异或操作以及最终得到校验值。 根据提供的引用资料,CRC32的核心是多项式除法,但实际中通过查表法优化速度。需要解释生成多项式,比如常见的0xEDB88320,以及初始值、输入输出是否反转这些参数。用户提供的代码片段中有两个版本,一个是逐位计算,另一个是查表法,这可能需要在回答中对比说明,突出查表法的效率优势。 接下来,用户可能关心具体怎么使用这个算法,比如在C语言中的实现步骤,或者如何应用到实际项目中,比如文件校验或网络传输。要分步骤讲解,从初始化到处理每个字节,再到最终计算,可能需要示例代码来辅助说明。同时,注意用户要求行内数学表达式用$...$,比如多项式应该写成$0xEDB88320$这样的格式。 另外,用户的问题里提到生成相关问题,我需要考虑相关的问题可能涉及性能优化、不同生成多项式的影响,或者CRC32与其他校验算法的比较。这些可以作为相关问题放在最后,帮助用户进一步探索。 需要确保回答结构清晰,先讲原理,再讲实现步骤,然后使用方法,最后附上相关问题。同时,引用提供的资料,比如引用[^1]和[^2]来支持解释。要避免技术术语过于复杂,保持语言通俗易懂,同时满足LaTeX格式要求,比如多项式用$符号包裹。检查是否有遗漏的步骤,比如输入反转和输出反转的处理,这在代码示例中有所体现,需要解释清楚这些参数的作用。</think>### CRC32校验算法实现及使用方法 #### 一、CRC32基本原理 CRC32通过多项式除法生成32位校验值,用于检测数据传输或存储中的错误。其核心是生成多项式$G(x)$,常用标准为$0xEDB88320$(反向多项式形式)[^1]。算法流程如下: 1. **初始化**:设置32位寄存器初值为$0xFFFFFFFF$ 2. **数据输入**:逐字节与寄存器异或运算 3. **位移处理**:根据多项式进行循环移位和异或操作 4. **结果取反**:最终值与$0xFFFFFFFF$异或 #### 二、算法实现(C语言) ```c // 查表法实现(高效) uint32_t crc32_table[256]; void init_crc32_table() { for (int i = 0; i < 256; i++) { uint32_t crc = i; for (int j = 0; j < 8; j++) { crc = (crc >> 1) ^ ((crc & 1) ? 0xEDB88320 : 0); } crc32_table[i] = crc; } } uint32_t calc_crc32(uint8_t *data, size_t len) { uint32_t crc = 0xFFFFFFFF; while (len--) { crc = (crc >> 8) ^ crc32_table[(crc ^ *data++) & 0xFF]; } return crc ^ 0xFFFFFFFF; } ``` 此实现通过预先生成的256元素查找表,将时间复杂度从$O(n \cdot 8)$优化到$O(n)$。 #### 三、使用场景及方法 1. **文件校验**:计算文件CRC32值验证完整性 ```bash $ crc32 filename.txt ``` 2. **网络传输**:在数据帧尾部附加4字节校验码 3. **存储系统**:RAID、ZFS等文件系统使用CRC32校验数据块 #### 四、参数配置 | 参数 | 说明 | 标准值 | |---------------|---------------------------|-----------------| | 初始值 | 寄存器初始状态 | 0xFFFFFFFF | | 多项式 | 生成多项式 | 0xEDB88320 | | 输入/输出反转 | 字节处理顺序 | 通常需要反转 |
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值