QTP MCQs and Answers With Explanation | QTP Quiz

QTP MCQs
Join Telegram Join Telegram
Join Whatsapp Groups Join Whatsapp

QTP MCQs and Answers With Explanation – Hey Guys!!! If you are browsing different websites to get the QTP Multiple Choice Questions then this is the right article for you. QTP or Quick Test Professional is an automated functional testing tool developed by Hewlett Packard (HP). It helps in performing automated regression testing of software applications. QTP stands for Quick Test Professional, and it’s an important tool for software testers to ensure the functionality and reliability of software applications. Now candidates who are in need of enhancing and improving their knowledge should go through this QTP Multiple choice Questions and Answers right away.

QTP Multiple Choice Questions and Answers

This article consists of HP QTP Online Quiz Test related to QTP, including its purpose, scripting language, add-ins, synchronization, recovery scenarios, and more. Get ready to test your knowledge of QTP and see how well you know this software testing tool.

Qtp MCQ Questions

Name QTP
Exam Type MCQ (Multiple Choice Questions)
Category Technical Quiz
Mode of Quiz Online

Top 50 QTP MCQs | Practice Online Quiz

1. What is QTP?

A. Quick Test Professional
B. Quality Testing Platform
C. Quick Testing Protocol
D. Query Testing Process

Answer: A. Quick Test Professional

Explanation: QTP stands for Quick Test Professional, it is an automated functional testing tool developed by Hewlett Packard (HP) that helps in performing automated regression testing of software applications.

2. What is the scripting language used in QTP?

A. Java
B. C++
C. VBScript
D. Python

Answer: C. VBScript

Explanation: VBScript is the scripting language used in QTP. It is a subset of Visual Basic language and is used to write the scripts for automation.

3. What is the purpose of QTP?

A. To perform functional and regression testing
B. To perform load testing
C. To perform security testing
D. To perform compatibility testing

Answer: A. To perform functional and regression testing

Explanation: The main purpose of QTP is to perform functional and regression testing of software applications.

4. What is the latest version of QTP?

A. QTP 9.2
B. QTP 10
C. QTP 11
D. QTP 12

Answer: D. QTP 12

Explanation: QTP 12 is the latest version of Quick Test Professional.

5. What is the default add-in in QTP?

A. Web
B. Java
C. .NET
D. ActiveX

Answer: A. Web

Explanation: The default add-in in QTP is the Web add-in, which is used to test web-based applications.

6. What is the purpose of checkpoints in QTP?

A. To compare expected and actual results
B. To debug the script
C. To record the script
D. To insert comments in the script

Answer: A. To compare expected and actual results

Explanation: Checkpoints are used in QTP to compare expected and actual results of a test. They help in verifying whether the application under test is functioning as expected or not.

7. What is the purpose of output values in QTP?

A. To verify the functionality of an application
B. To display the results of a test run
C. To parameterize the values in a test
D. To store data for later use in the script

Answer: D. To store data for later use in the script

Explanation: Output values are used in QTP to store data that can be used later in the script. They help in parameterizing the values in a test and in creating data-driven tests.

8. Which object repository mode allows you to modify the test object properties while running a test in QTP?

A. Shared
B. Local
C. Global
D. Action

Answer: B. Local

Explanation: Local object repository mode allows you to modify the test object properties while running a test in QTP. It is used when you want to modify the properties of the test objects temporarily.

9. What is the purpose of recovery scenarios in QTP?

A. To recover from errors during a test run
B. To recover deleted files
C. To recover from system crashes
D. To recover deleted test cases

Answer: A. To recover from errors during a test run

Explanation: Recovery scenarios are used in QTP to recover from errors that occur during a test run. They help in ensuring that the test script continues to run even if unexpected errors occur.

10. What is the purpose of virtual objects in QTP?

A. To simulate the behavior of missing or unavailable objects
B. To simulate the behavior of the real objects
C. To enhance the performance of the script
D. To reduce the maintenance effort of the script

Answer: A. To simulate the behavior of missing or unavailable objects

Explanation: Virtual objects are used in QTP to simulate the behavior of missing or unavailable objects. They help in testing applications that use custom controls or non-standard objects.

11. What is the purpose of synchronization in QTP?

A. To ensure that the script runs at the right time
B. To ensure that the application is in the right state before the script runs
C. To ensure that the script runs at the right speed
D. To ensure that the application is closed properly after the script runs

Answer: B. To ensure that the application is in the right state before the script runs

Explanation: Synchronization is used in QTP to ensure that the application is in the right state before the script runs. It helps in avoiding timing issues that can cause the script to fail.

12. What is the purpose of the Object Spy in QTP?

A. To view the properties and methods of an object
B. To view the test results
C. To view the script code
D. To view the execution log

Answer: A. To view the properties and methods of an object

Explanation: The Object Spy in QTP is used to view the properties and methods of an object. It helps in identifying the objects in an application and in creating test scripts.

13. What is the purpose of the Step Generator in QTP?

A. To generate test steps automatically
B. To debug the script
C. To record the script
D. To insert comments in the script

Answer: A. To generate test steps automatically

Explanation: The Step Generator in QTP is used to generate test steps automatically. It helps in creating test scripts quickly and efficiently.

14. Which recording mode in QTP records only the user actions and not the application’s responses?

A. Analog
B. Low-level
C. Normal
D. Context-sensitive

Answer: A. Analog

Explanation: Analog recording mode in QTP records only the user actions and not the application’s responses. It is used when the application is not recognized by QTP’s other recording modes.

15. What is the purpose of the Test Batch Runner in QTP?

A. To run multiple tests in a batch
B. To schedule tests to run at a specific time
C. To view the test results
D. To create test reports

Answer: A. To run multiple tests in a batch

Explanation: The Test Batch Runner in QTP is used to run multiple tests in a batch. It helps in saving time and in running tests efficiently.

16. What is the purpose of the Test Results Viewer in QTP?

A. To view the test results
B. To view the script code
C. To view the execution log
D. To view the Object Repository

Answer: A. To view the test results

Explanation: The Test Results Viewer in QTP is used to view the test results. It provides detailed information about the test run and helps in analyzing the results.

17. Which statement is used to check if an object exists in QTP?

A. If Not IsObject(obj)
B. If Not obj Is Nothing
C. If obj.Exists()
D. If obj IsNot Nothing

Answer: B. If Not obj Is Nothing

Explanation: The statement “If Not obj Is Nothing” is used to check if an object exists in QTP. It returns True if the object exists and False if it does not.

18. What is the purpose of the Data Table in QTP?

A. To store input and output values
B. To store the script code
C. To store the execution log
D. To store the Object Repository

Answer: A.To store input and output values

Explanation: The Data Table in QTP is used to store input and output values. It helps in parameterizing the test scripts and in creating data-driven tests.

19. What is the purpose of the Reporter in QTP?

A. To view the test results
B. To view the script code
C. To view the execution log
D. To view the Object Repository

Answer: A. To view the test results

Explanation: The Reporter in QTP is used to view the test results. It provides a customizable report that can be used to analyze the test results.

20. What is the purpose of the Smart Identification mechanism in QTP?

A. To identify objects that are not recognized by the Object Repository
B. To identify objects that are present in the wrong location
C. To identify objects that are not visible to the user
D. To identify objects that are not supported by the application

Answer: A. To identify objects that are not recognized by the Object Repository

Explanation: The Smart Identification mechanism in QTP is used to identify objects that are not recognized by the Object Repository. It uses a set of algorithms to identify the objects based on their properties and behavior.

21. What is the purpose of the Debug Viewer in QTP?

A. To view the script code
B. To view the execution log
C. To view the test results
D. To debug the script

Answer: D. To debug the script

Explanation: The Debug Viewer in QTP is used to debug the script. It provides a detailed view of the script execution and helps in identifying and fixing errors.

22. Which statement is used to exit a loop in QTP?

A. Exit Loop
B. End Loop
C. Loop Until
D. Exit Do

Answer: A. Exit Loop

Explanation: The statement “Exit Loop” is used to exit a loop in QTP. It is used when a condition is met and the loop needs to be terminated.

23. What is the purpose of the ChildObjects method in QTP?

A. To return the collection of child objects of an object
B. To return the collection of parent objects of an object
C. To return the collection of all objects in the Object Repository
D. To return the collection of objects that match a specified test object description

Answer: A. To return the collection of child objects of an object

Explanation: The ChildObjects method in QTP is used to return the collection of child objects of an object. It helps in identifying the child objects of an object and in creating test scripts.

24. What is the purpose of the GetTOProperty method in QTP?

A. To get the value of a test object property
B. To set the value of a test object property
C. To get the value of an environment variable
D. To set the value of an environment variable

Answer: A. To get the value of a test object property

Explanation: The GetTOProperty method in QTP is used to get the value of a test object property. It helps in retrieving the property values of test objects and in creating test scripts.

25. What is the purpose of the SetTOProperty method in QTP?

A. To get the value of a test object property
B. To set the value of a test object property
C. To get the value of an environment variable
D. To set the value of an environment variable

Answer: B. To set the value of a test object property

Explanation: The SetTOProperty method in QTP is used to set the value of a test object property. It helps in modifying the property values of test objects and in creating test scripts.

26. What is the purpose of the ChildItem method in QTP?

A. To return the child object at a specified index of an object
B. To return the parent object of an object
C. To return the collection of child objects of an object
D. To return the collection of all objects in the Object Repository

Answer: A. To return the child object at a specified index of an object

Explanation: The ChildItem method in QTP is used to return the child object at a specified index of an object. It helps in identifying the child objects of an object and in creating test scripts.

27. What is the purpose of the Checkpoint mechanism in QTP?

A. To validate the expected behavior of an application
B. To verify the correctness of a test script
C. To capture and compare screenshots
D. To perform synchronization between test steps

Answer: A. To validate the expected behavior of an application

Explanation: The Checkpoint mechanism in QTP is used to validate the expected behavior of an application. It helps in identifying deviations from the expected behavior and in creating test scripts.

28. What is the purpose of the TextCheckpoint in QTP?

A. To check the presence of a text string in an object
B. To check the font size of a text string in an object
C. To check the color of a text string in an object
D. To check the alignment of a text string in an object

Answer: A. To check the presence of a text string in an object

Explanation: The TextCheckpoint in QTP is used to check the presence of a text string in an object. It helps in validating the text content of an object and in creating test scripts.

29. What is the purpose of the BitmapCheckpoint in QTP?

A. To check the presence of an image in an object
B. To check the color of an image in an object
C. To check the alignment of an image in an object
D. To check the size of an image in an object

Answer: A. To check the presence of an image in an object

Explanation: The BitmapCheckpoint in QTP is used to check the presence of an image in an object. It helps in validating the image content of an object and in creating test scripts.

30. What is the purpose of the PageCheckpoint in QTP?

A. To check the presence of a web page
B. To check the page title of a web page
C. To check the URL of a web page
D. To check the HTML source of a web page

Answer: A. To check the presence of a web page

Explanation: The PageCheckpoint in QTP is used to check the presence of a web page. It helps in validating the web page content and in creating test scripts.

31. What is the purpose of the Standard Checkpoint in QTP?

A. To check the properties of an object
B. To check the text content of an object
C. To check the image content of an object
D. To check the web page content

Answer: A. To check the properties of an object

Explanation: The Standard Checkpoint in QTP is used to check the properties of an object. It helps in validating the object properties and in creating test scripts.

32. What is the purpose of the Image Checkpoint in QTP?

A. To check the presence of an image in an object
B. To check the color of an image in an object
C. To check the alignment of an image in an object
D. To check the size of an image in an object

Answer: B. To check the color of an image in an object

Explanation: The Image Checkpoint in QTP is used to check the color of an image in an object. It helps in validating the image color and in creating test scripts.

33. What is the purpose of the Table Checkpoint in QTP?

A. To check the presence of a table in a web page
B. To check the number of rows in a table
C. To check the number of columns in a table
D. To check the content of a table

Answer: D. To check the content of a table

Explanation: The Table Checkpoint in QTP is used to check the content of a table. It helps in validating the table content and in creating test scripts.

34. What is the purpose of the Accessibility Checkpoint in QTP?

A. To check the accessibility of an application for people with disabilities
B. To check the security of an application
C. To check the performance of an application
D. To check the compatibility of an application with different browsers

Answer: A. To check the accessibility of an application for people with disabilities

Explanation: The Accessibility Checkpoint in QTP is used to check the accessibility of an application for people with disabilities. It helps in ensuring that the application is accessible to everyone and in creating test scripts.

35. What is the purpose of the Database Checkpoint in QTP?

A. To check the data in a database
B. To check the database schema
C. To check the performance of a database
D. To check the security of a database

Answer: A. To check the data in a database

Explanation: The Database Checkpoint in QTP is used to check the data in a database. It helps in validating the data in the database and in creating test scripts.

36. What is the purpose of the Batch Test Runner in QTP?

A. To run multiple test scripts in a sequence
B. To run multiple test scripts in parallel
C. To run test scripts with different configurations
D. To run test scripts on remote machines

Answer: A. To run multiple test scripts in a sequence

Explanation: The Batch Test Runner in QTP is used to run multiple test scripts in a sequence. It helps in automating the execution of multiple test scripts and in creating test reports.

37. What is the purpose of the Virtual Object Wizard in QTP?

A. To create virtual objects
B. To modify virtual objects
C. To delete virtual objects
D. To view virtual objects

Answer: A. To create virtual objects

Explanation: The Virtual Object Wizard in QTP is used to create virtual objects. It helps in handling objects that are not recognized by QTP and in creating test scripts.

38. Which statement is used to create a new Excel.Application object in QTP?

A. Set objExcel = CreateObject(“Excel.Application”)
B. Set objExcel = New Excel.Application
C. Set objExcel = CreateObject(“Excel.Application.1”)
D. Set objExcel = New Excel.Application.1

Answer: A. Set objExcel = CreateObject(“Excel.Application”)

Explanation: The statement “Set objExcel = CreateObject(“Excel.Application”)” is used to create a new Excel.Application object in QTP.

39. Which statement is used to close an Excel workbook in QTP?

A. objExcel.Quit
B. objWorkbook.Close
C. objWorksheet.Close
D. objExcel.Close

Answer: B. objWorkbook.Close

Explanation: The statement “objWorkbook.Close” is used to close an Excel workbook in QTP.

40. Which statement is used to select a cell in an Excel worksheet in QTP?

A. objExcel.Range(“A1”).Select
B. objWorkbook.Range(“A1”).Select
C. objWorksheet.Range(“A1”).Select
D. objWorksheet.Cells(1, 1).Select

Answer: D. objWorksheet.Cells(1, 1).Select

Explanation: The statement “objWorksheet.Cells(1, 1).Select” is used to select a cell in an Excel worksheet in QTP.

41. Which statement is used to add a new row to an Excel worksheet in QTP?

A. objExcel.Rows.Add
B. objWorkbook.Rows.Add
C. objWorksheet.Rows.Add
D. objWorksheet.Cells(1, 1).EntireRow.Insert

Answer: D. objWorksheet.Cells(1, 1).EntireRow.Insert

Explanation: The statement “objWorksheet.Cells(1, 1).EntireRow.Insert” is used to add a new row to an Excel worksheet in QTP.

42. Which statement is used to read data from an Excel worksheet in QTP?

A. objWorksheet.Range(“A1”).Value
B. objWorksheet.Cells(1, 1).Value
C. objWorksheet.Rows(1).Value
D. objWorksheet.Columns(1).Value

Answer: B. objWorksheet.Cells(1, 1).Value

Explanation: The statement “objWorksheet.Cells(1, 1).Value” is used to read data from an Excel worksheet in QTP.

43. Which statement is used to write data to an Excel worksheet in QTP?

A. objWorksheet.Range(“A1”).Value = “Data”
B. objWorksheet.Cells(1, 1).Value = “Data”
C. objWorksheet.Rows(1).Value = “Data”
D. objWorksheet.Columns(1).Value = “Data”

Answer: B. objWorksheet.Cells(1, 1).Value = “Data”

Explanation: The statement “objWorksheet.Cells(1, 1).Value = “Data”” is used to write data to an Excel worksheet in QTP.

44. Which statement is used to create a new text file in QTP?

A. Set objFile = CreateObject(“Scripting.FileSystemObject”).CreateTextFile(“C:\Test.txt”)
B. Set objFile = New Scripting.FileSystemObject
C. Set objFile = CreateObject(“Text.File”)
D. Set objFile = New Text.File

Answer: A. Set objFile = CreateObject(“Scripting.FileSystemObject”).CreateTextFile(“C:\Test.txt”)

Explanation: The statement “Set objFile = CreateObject(“Scripting.FileSystemObject”).CreateTextFile(“C:\Test.txt”)” is used to create a new text file in QTP.

45. Which statement is used to write data to a text file in QTP?

A. objFile.Write(“Data”)
B. objFile.WriteLine(“Data”)
C. objFile.Print(“Data”)
D. objFile.Put(“Data”)

Answer: B. objFile.WriteLine(“Data”)

Explanation: The statement “objFile.WriteLine(“Data”)” is used to write data to a text file in QTP.

The Qtp MCQ Questions that are provided above will be surely helpful to the candidates who are in search of it to quest their thirst for knowledge. Now follow our Freshersnow daily to get more useful software-related concepts.