QTP (QuickTest Professional) lets you create tests and business components by recording operations as you perform them in your application.
1)Planning : Before starting to build a test, you should plan it and prepare the required infrastructure. For example, determine the functionality you want to test, short tests that check specific functions of the application or complete site.Decide how you want to organize your object repositories.
2)Creating Tests or Components:
We can create a test or component by
a) Either recording a session on your application or Web site.
As we navigate through the application or site, QuickTest graphically displays each step we perform as a row in the Keyword View. The Documentation column of the Keyword View also displays a description of each step in easy-to-understand sentences. A step is something that causes or makes a change in your site or application, such as clicking a link or image, or submitting a data form.
OR b) Build an object repository and use these objects to add steps manually in the Keyword View or Expert View. We can then modify your test or component with special testing options and/or with programming statements.
3)Inserting Checkpoints: Insert Checkpoints into your test or component. A checkpoint is a verification point that compares a recent value for a specified property with the expected value for that property. This enables you to identify whether the Web site or application is functioning correctly.
4)Broaden the scope of your test or component by replacing fixed values with parameters:
To check how your application performs the same operations with different data you can parameterize your test or component. When you parameterize your test or component, QuickTest substitutes the fixed values in your test or component with parameters Each run session that uses a different set of parameterized data is called an iteration.
We can also use output values to extract data from our test or component. An output value is a value retrieved during the run session and entered into the Data Table or saved as a variable or a parameter. We can subsequently use this output value as input data in your test or component.We can use many functional testing features of QuickTest to improve your test or component and/or add programming statements to achieve more complex testing goals.
5)Run Test Component:
Run test or component to check the site or application. When we run the test or component, QuickTest connects to your Web site or application and performs each operation in a test or component, checking any text strings, objects, or tables you specified. If we parameterized the test with Data Table parameters, QuickTest repeats the test (or specific actions in your test) for each set of data values we defined.
Run the test or component to debug it.We can control the run session to identify and eliminate defects in the test or component. We can use the Step Into, Step Over,
And Step Outcommands to run a test or component step by step. We can also set breakpoints to pause the test or component at pre-determined points. We can view the value of variables in the test or component each time it stops at a breakpoint in the Debug Viewer.
6)Analyzing Results:
After we run test or component, we can view the results.
1. View the results in the Results window.
After running the test or component, we can view the results of the run in the Test Results window. We can view a summary of the results as well as a detailed report.
2. Report defects identified during a run session.
Thursday, July 9, 2009
Saturday, May 9, 2009
Guidelines for Unit Testing

1. Keep unit tests small and fast.
2. Unit tests should be fully automated and non-interactive
3. Make unit tests simple to run
4. Measure the tests
5. Fix failing tests immediately
6. Keep testing at unit level
7. Start off simple
8. Keep tests independent
9. Keep tests close to the class being tested
10. Name tests properly
11. Test public API
12. Think black-box
13. Think white-box
14. Test the trivial cases too
15. Focus on execution coverage first
16. Cover boundary cases
17. Provide a random generator
18. Test each feature once
19. Use explicit asserts
20. Provide negative tests
21. Design code with testing in mind
22. Prioritize testing
23. Prepare test code for failures
24. Write tests to reproduce bugs
25. Know the limitations
Labels:
blackbox,
boundaycases,
test guidelines,
UnitTests,
whitebox
Subscribe to:
Posts (Atom)
