QTP Interview Questions and Answers
Question - 61 : - What is a Run-Time Data Table? Where can I find and view this table?
Answer - 61 : -
Data like parameterized output , checkpoint values , output values are stored in the Run-time Table. It is an xls file which is stored in the Test Results Folder. It can also be accessed in the Test Fusion Report.
Question - 62 : - What is the difference between check point and output value.
Answer - 62 : -
Check point is a verification point that compares a current value for a specified property with the expected value for that property. Based on this comparison, it will generate a PASS or FAIL status.
An output value is a value captured during the test run and can be stored in a specified location like the Datable or even a variable. Unlike Checkpoints, no PASS/FAIL status is generated.
Question - 63 : - How would you connect to database using VBScript?
Answer - 63 : -
To connect to the database you must know
a) connection string of your server
b) username
c) password
d) DNS name
You can code the database connectivity command directly or you can use the SQL Query tool provided by QTP.
Question - 64 : - What is QTP batch testing tool?
Answer - 64 : -
You can use the Batch testing tool to run multiple scripts. Once the scripts are added in the tool , it will automatically open the scripts and start executing them one after the other.
Question - 65 : - What are the drawbacks of QTP?
Answer - 65 : -
As of QTP version 10
1) Huge Tests in QTP consume lots of memory and increase CPU utilization.
2) Since QTP stores results in HTML file (and not txt) the result folder sometimes becomes big.
Question - 66 : - What is an Optional Step?
Answer - 66 : -
A step when declared optional is not mandatory to be executed. If the corresponding GUI object is present, QTP performs the operation on it. If the GUI object is not present, QTP bypasses the optional step and proceeds to execute the next step.
Question - 67 : - What is Reporter.ReportEvent?
Answer - 67 : -
Reporter.Reportvent is standard method provided by QTP to send custom messages to the test results window.
Syntax
Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
where
EventStatus = 0 or micPass
1 or micFail
2 or micDone
3 or micWarning
Results can assume any status like Pass , Fail , Warning etc. You can also send screenshot to the test results window.
Question - 68 : - How will you declare a variable in QTP?
Answer - 68 : -
You declare using a DIM keyword. You assign value to the variable using the SET keyword.
Ex.
Dim temp ‘Will declare the temp variable
Set temp = 20 ‘ Will assign a value 20 to temp.
Question - 69 : - What is GetRoProperty?
Answer - 69 : -
GetRoProperty is a standard method provided by QTP to fetch property values of a run -time object.
Question - 70 : - If the Global Data sheet contains no data and the Local Datasheet contains two rows of data, how many times will the test iterate?
Answer - 70 : -
The test will iterate only once – global iteration.