Examples of use of automated test tools QTP

Source: Internet
Author: User

1. QTP profile 1.1QTP features and features

QTP is the abbreviation of QuickTest Professional and is an automated software testing tool. During software testing, QTP is primarily used to perform repetitive manual tests with existing test scripts for functional testing and regression testing. Using QTP requires testers to consider the content, steps, input data, and expected output data of the application test before testing.

QTP was developed by Mercury, the company developed similar products and LoadRunner, but Mercury has been acquired by HP, now the two major enterprise software testing tools are owned by HP's commercial products. The biggest difference between QTP and LoadRunner is that the focus of the two is different, the QTP focuses on the functional testing and regression testing of the software, which is a functional testing tool, and LoadRunner focuses on the software's stress and load performance testing.

1.2 Advantages of automated testing

Automated testing compared to manual testing, has a prominent somewhat. Manual testing is a waste of time and requires error-prone. The result of using a manual test is that it is often impossible to fully test all of the application's functionality until the application is delivered. QuickTest can speed up the entire test process and can be tested repeatedly using test scripts. The benefits of using QTP for automated testing are obvious and are summarized as follows:

Advantages Description
Fast QTP performs tests much faster than manual testing.
Reliable QTP Each test can perform the same action correctly, which avoids the error of manual testing.
Repeatable QTP can perform the same test repeatedly.
can be programmed QTP can write complex test scripts in a procedural way to bring out the information hidden in the application.
Generalized QTP can build extensive test scripts that cover all the features of the application. You can reuse the test script with QTP, even if the application interface has changed.
1.3 QTP Installation FAQs

QTP Latest Version official see
Http://www8.hp.com/us/en/software-solutions/unified-functional-automated-testing/index.html#.UNMOQ2_FWS8. QTP on the official website has been renamed UFT (Unified Functional testing) unified functional testing, or download Thunder download version 11.0: Http://kuai.xunlei.com/d/EIWJMUDNHFBA.

Installation issues that are encountered after the download is completed are primarily prompted to install the component computer without the Microsoft Visual C + + runtime component, but the installation still fails after the installation is found. Solution go inside the installation directory under the unpacked directory Quicktest\chs\prerequisites\vc2005_sp1_redist there is a vcredist_x86 installation file, click Install.

2. Test Platform

Using QTP for functional testing, the platform information for the experiment is as follows:

Operating system Windows 7 64bit
Memory 4GB
Cpu AMD X4 640
Test tools QTP11.0
Test object notepad++6.7.9

3. Test steps

Using QTP to perform a simple function test of the text editor notepad++, mainly including the new text file, the output
Delete, and save. The main operating steps are as follows:
(1) Open notepad++, click on the Level menu file under the two menu new new nameless text file.
(2) Enter Hello World and enter this is test again.
(3) Check test to delete.
(4) then click on the "Save as" under the menu file. Save the path to a local table, named Lvlv.cpp
Surface.

4. Recording Scripts

To open the installed QTP, the main interface is as follows:

When browsing the website or using the application, QTP will record your steps and generate a test script. When you stop recording, you'll see QTP steps to display the test script in a tabular way in keyword View.

Click the New button in the upper left corner of the main interface to create a test case, select Test>record or click the Record button on the toolbar. Open the Record and Run Settings dialog window:

Because we want to test the form application, select the Windows Applications option as shown in. Click the Green Plus button to add the app being tested, pop up the following object frame, we select notepad++ as our test object, and select the Working Directory working folder as the path to save the script. As shown in the following:

Once setup is complete, click OK to follow the previous setup test steps and record the test script. During the recording process, QuickTest generates a corresponding record of each operation in the Test Script Management window (also called the Tree View window). The recorded test script is displayed in Keyword view in a similar way to an Excel worksheet. When the recording is complete, QuickTest also records all actions during the test. The Test Script Management window displays the contents as shown in the following:

You can observe the test script by switching to expert view in the Test Script Management window. The contents are as follows:

Window ("notepad++ [Administrator]"). Winmenu("Menu"). Select "File; New Ctrl + N "Window ("notepad++ [Administrator]"). Winobject("Hello World"). Type "Hello World"Window ("notepad++ [Administrator]"). Winobject("Hello World"). TypeMicreturn Window ("notepad++ [Administrator]"). Winobject("Hello World"). Type "This is test"Window ("notepad++ [Administrator]"). Winobject("Hello World"). Drag 157, theWindow ("notepad++ [Administrator]"). Winobject("Hello World"). Drop 113, -Window ("notepad++ [Administrator]"). Winobject("Hello World"). TypeMicback Window ("notepad++ [Administrator]"). Winmenu("ContextMenu"). Select "File;  Save as ... Ctrl+alt+s "Window ("notepad++ [Administrator]"). Dialog("Save As"). Winedit("file name (N):"). Set "Lvlv.cpp"Window ("notepad++ [Administrator]"). Dialog("Save As"). Winbutton("Save (S)"). Click

The results of the final notepad++ were edited as follows:

5. Modify script and Playback 5.1 modify script

Add the above recorded script to the following two lines:

Window("Notepad++ [Administrator]").WinObject("hello world ").Type  micReturn Window("Notepad++ [Administrator]").WinObject("hello world").Type" add by scripts"

Adding these two lines means that after the test is removed, the add by scripts value Lvlv.cpp is added by the script, as shown in the red box where the script is added.

5.2 Playback of scripts

Delete the original Lvlv.cpp file from the desktop, replay it through the script and generate the Lvlv.cpp file again, and see if the contents of the file are determined by the expected script execution to verify the correctness of the script execution.

Click the Run button in the upper-left corner of the QTP to set the test result save path and then play back the modified script. This test path is set as follows:

Replay the modified script successfully, open the newly generated lvlv.cpp, and its contents as modified by the script, the correct addition to the add by script. The contents of the file are as follows:

6. Summary

Through this test experiment, I have a certain understanding of the functional test tool quicktest professional. Understand the installation of QuickTest Professional, the basic process of functional testing and the writing of test scripts have a certain understanding. The importance of automated testing in the software declaration cycle and the irreplaceable advantages of relative manual testing are also deeply felt.

In the early stage of this experiment, we searched the information about the related test tools, and in this process I learned a lot of knowledge of software testing and improved the interest of software testing. Through this study, in the Future project, you can test tool quicktest to their own project functional testing, so as to simplify the testing process, to achieve knowledge.

Examples of use of automated test tools QTP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.