天天看點

QTP入門

什麼是QTP:摘自WIKI

HP QuickTest Professional is automated testing software designed for testing various software applications and environments. It performs functional and regression testing through a user interface such as a native GUI or web interface.[7] It works by identifying the objects in the application user interface or a web page and performing desired operations (such as mouse clicks or keyboard events); it can also capture object properties like name or handler ID. HP QuickTest Professional uses a VBScript scripting language to specify the test procedure and to manipulate the objects and controls of the application under test. To perform more sophisticated actions, users may need to manipulate the underlying VBScript.[8]

Although HP QuickTest Professional is usually used for "UI Based" Test Case Automation, it also can automate some "Non-UI" based Test Cases such as file system operations and database testing.[9]

http://en.wikipedia.org/wiki/HP_QuickTest_Professional

QTP的基本功能:

建立測試(建立新測試,錄制腳本,儲存和回放)

檢驗資料:插入檢查點

增強測試:進行腳本程式設計,如檢查點檢查

運作測試

分析結果

維護測試:當測試對象 發生改變時

Benefit of automationg test:

Benefits of Automated Testing
Fast QuickTest runs tests significantly faster than human users.
Reliable Tests perform precisely the same operations each time they are run, thereby eliminating human error.
Repeatable You can test how the Web site or application reacts after repeated execution of the same operations.
Programmable You can program sophisticated tests that bring out hidden information.
Comprehensive You can build a suite of tests that covers every feature in your Web site or application.
Reusable You can reuse tests on different versions of a Web site or application, even if the user interface changes.

QTP測試的步驟:

The QuickTest testing process consists of seven main phases:

    • Preparing to record

    Before you record a test, confirm that your application and QuickTest are set to match the needs of your test.

    Make sure your application displays elements on which you want to record, such as a toolbar or a special window pane, for example, and that your application options are set as you expect for the purposes of your test.

    • Recording a session on your application
    As you navigate through your application or Web site, QuickTest graphically displays each step you perform as a row in the Keyword View. A step is any user action that causes or makes a change in your application, such as clicking a link or image, or entering data in a form.
    • Enhancing your test
      • Inserting checkpoints into your test lets you search for a specific value of a page, object, or text string, which helps you determine whether your application or site is functioning correctly.
      • Broadening the scope of your test, by replacing fixed values with parameters, lets you check how your application performs the same operations with multiple sets of data.
      • Adding logic and conditional or loop statements enables you to add sophisticated checks to your test.
    • Debugging your test
    You debug a test to ensure that it operates smoothly and without interruption.
    • Running your test
    You run a test to check the behavior of your application or Web site. While running, QuickTest opens the application, or connects to the Web site, and performs each step in your test.
    • Analyzing the test results
    You examine the test results to pinpoint defects in your application.
    • Reporting defects
    If you have Quality Center installed, you can report the defects you discover to a database. Quality Center is the Mercury test management solution.