Challenging QTP Questions | Judge yourself in QTP

Share This Post -

Part 1

1) How a variable can be made to be accessed by all the Actions of a Test?

Hint:

a) By using GlobalDataSheet

b) By using Environment variable

c) By Public Function

 

2) Which Environment variable is used to read product License from a File?

Hint: LSHOST

3) The General Error message that appears on loading a file using Environment.LoadFile method is “The format of File is incorrect”. What type of Files can be loaded?

 

4) How can you add a run-time property to a Test object?

 

5) How can you add a custom property to a Test object?

 

6) What are the other environments supported by QTP?

 

7) Find out the Error

Browser(“Welcome:MercuryTours”).Page(“Itinerary:MercuryTours”).Check Checkpoint(“text:=Itinerary”)

 

8) The first line of an Action is to be executed for the First action iteration and the rest of lines have to be executed for the rest of Iterations. What is the best approach?

 

9) A reusable action Parent, calls another reusable action Child. How can you make the Data Table of Child as a local editable copy?

 

10) Which Exit statements are used by non-BPT’s?

 

Hint: ExitRun, ExitGlobalIteration, ExitAction

 

11) Which of the following is True?

a) If smart Identification is enabled, QTP ignores the object Repository and prepares a candidate list using mandatory properties.

b) If smart Identification is enabled, QTP ignores the object Repository and prepares a candidate list using Base Filter properties.

c) If smart Identification is enabled, QTP ignores the object Repository and prepares a candidate list using assistive properties.

 

Part 2

1) What method is used to initiate an object?

 

2) What are the two ADO objects?

 

3) How can you create an Excel log during run-time?

 

4) What are the various Filter modes of Reporter object?

 

5) Complete the code given below

Dim oBrowser,rc

_____________________

oBrowser(“html tag”).value=”INPUT”

_____________________

For i=0 to rc.count-1

Next

 

Part 3

1) a) Create a reusable action that inserts an Order. Output the order number to Test results.

b) Create a reusable action that Fax the order .

c) Call the above two actions in a Script an iterate it for 6 times.

 

2)

a) Create a custom function that overrides the Set method of WinCheckbox

The function should be able to select the Checkbox if the value is either “ON” or “TRUE”. The function should be able to deselect the Checkbox if the value is either “OFF” or “FALSE”. The error handling should be available if an incorrect value is passed.

b) Ensure that the Flight reservation window is opened. Open order #3.

Change the default value from ‘ON’ to ‘True’.

 

3) Using Descriptive programming insert an order and Fax the order.

 

Must Read: Tricky QTP Questions