Text Output values enable you to capture text appearing on the application under test during run-time.
If parameterized, text output values will capture values appearing in each iteration which would be stored in the run-time data table for further analysis.
22) What is Step Generator?
Step Generator enables use to Add Test Steps in your script. Using step generator you can add steps to your script without actually recording it.
23) How to make QTP understand the difference amongst the same type of objects .Suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?
You can use ordinal identifiers like index along with a little descriptive programming for object recognition.
Watch a video of this example.
24) What is Test Fusion Report ?.
Test Fusion Report , displays all aspects of a test run and is organized in a Tree format.
It gives details of each step executed for all iterations.
It also gives Run-time data table, Screen shots and movie of the test run if opted.
25) How can you handle exceptions in QTP?
In QTP Exceptional handling is done by using
a. Recovery Scenarios.
b. Using “On Error” statement
In Recovery scenario you have to define.
1. Triggered Events.
2. Recovery steps.
3. Post Recovery Test-Run.
At Script Level you can use the On Error Resume Next and On Error Go to 0 statement.
26) What are the types of environment variables in QTP ?
Environment variables in QTP are of three types:
1) Built-in (Read only)
2) User-defined Internal (Read only)
3) User-defined External (Read/Write)
You Set the Environment Variable using the following syntax
Environment.Value( “name”) = “Guru99”
You can Retrieve the Environment Variable using following syntax
Environment.Value(“name”) — This will retrun name as Guru99
Environment.Value(“OS”) — This will return your system OS
27) What is the Difference between Bitmap Check point & Image Check point?
Bitmap checkpoint does a pixel to pixel comparison of an image or part of an image.
Image checkpoint does do a pixel to pixel comparison but instead compare image properties like alt text , destination url etc.
28) What is the difference between functions and actions in QTP?
Actions have their own Object Repository & Data Table. Actions help make your Test modular and increase reuse. Example: You can divide your script into Actions based on functionality like Login, Logout etc.
Functions is a VB Script programming concept and do not have their own Object Repository or Data Table. Functions help in re-use of your code. Ex: You can create a Function in your script to concatenate two strings.
29) What is keyword view and Expert view in QTP?
Keyword View is an icon based view which shows test steps in tabular format. It also automatically generates documentation for the test steps.
Expert View gives the corresponding VB Script statement for every test step in the Keyword view.
30) Explain QTP Testing process?
Quick Test testing process consists of 6 main phases:
1) Create your test plan – This is preparatory phase where you identify the exact test steps, test data and expected results for you automated test. You also identify the environment and system configurations required to create and run your QTP Tests.
2) Recording a session on your application – During this phase , you will execute test steps one by one on your AUT ,and QTP will automatically record corresponding VB script statements for each step performed.
3) Enhancing your test – In this stage you will insert checkpoints , output values , parameterization , programming logic like if…else loops to enhance the logic of your test script.
4) Replay & Debug – After enhancements you will replay the script to check whether its working properly and debug if necessary.
5) Run your Tests – In this phase you will perform the actual execution of your Test Script.
6) Analyzing the test results – Once test run is complete, you will analyze the results in the Test Fusion report generated.
7) Reporting defects – Any incidents identified needs to be reported. If you are using Quality Center , defects can be automatically raised for failed tests in QTP.