QTP Interview Questions

1. Write a QTP script to print all the link names displayed in a web page.
2. What is the entry criteria and exit criteria for your test automation ?
3. Suppose I have a 10 lines of qtp script, while executing I got an error at line 7 but I dont want to stop the execution. I want to continue the execution up to last line and display the test result window, what is the syntax we use?
4. Who has developed QTP ? Is it from Mecury or HP .
5. Write Script using Descriptive programming to logn an application .
6. What is the extension of Local object repository file ?
7. What is the extension of Shared object repository file ?
8. Apart from VB script What are the fundamental criteria to gain the knowledge to write QTP script without OR and recording ?
9. What is the extension of action script template?
10. How can I parameterize the standard checkpoint using Excel sheet where my expected values are there? Suppose I want to test a application with diffent value and want to run 5 iteration and for each iteration, values will be exported from excel sheet as input. Also store some expected values in the excel sheet, which I want to check in the application whether expected equals to actual value?
11. Suppose in one page we have 100 links and I have to click the 99th link how can I click the 99th link ?
12. How to get number of columns and rows from an Excel sheet?
13. Why a framework is needed?
14. How to merge object repositories in qtp for N different applications ?
15. What is the condition or scenario that leads the use of object spy in qtp? (while recording we can get all the properties) then what leads to use this?
16. What is the purpose of SetTOProperty Method?
17. What is the difference between GetROProperty and GetTOProperty
18. What is meant by descriptive programming?
19. Write a VBscript code to parametrize test script using test data from sqlserver database?
20. How to count number of edit boxes on the page?
21. How to display the first 3 letters in these "ABCDEFGH" using qtp script?
22. X=10,Y=20 How to swap the numbers without using a third variable?
23. How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?
24. If already everything is tested using White-Box testing, then what is the need of using Black box testing?
25. How to create an instance in QTP?
26. Write a script to only download pdf's if there are 20 links on a page.
27. Write the regular expression for date format of mm/dd/yy?
28. What is the differnce between QC & QTP?
29. What are the main differences between keyword driven frame work and data driven frame work?
30. What is life cycle of automation testing ?
31. Write script to read and write data from file ?
32. Suppose we are having 10 checkboxes..How can We check only first 5 check boxes by using descriptive programing?
33. What are the three challenges you faced during automation testing of your application.
34. What is the difference between Client/Server application and Web application ?
35. How can we check whether a particular sheet loaded (existed) or not in Data Table.
36. Script to delete cookies.
37. How we can differentiate between stand alone application and web application in QTP?
38. Write script for finding number of broken links in web page? kindly please answer my question.
39. Suppose you run your script today and it is working fine ,nobody has changed the setting and you are the owner for the script. But when tomorrow I ran the same script again it got failed and It didn't able to identify one object. Can you tell me what would be the reason for this ?
40. Where do you maintain qtp scripts in your company?
41. What is the smart identification technique?
42. What are the different kinds of frameworks in automation?
43. What is On Error Resume Next ?
44. Is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP?
45. In qtp how you can retrive from a browser how many links are there.(means total no of links used in a browser)
46. Write a function which returns the addition of two numbers. give the value of the numbers outside the function.
47. How to display message without using msgbox function?
48. Engineering the regression testing from 0% to 60% automation. This has saved 4-mandays in every release. what doeas this statement means
49. What is the entry and exit point of automation testing ?
50. Can i able to connect any version of qtp to any version qc ?
51. What is the criteria for choosing test cases for automation? Ex: if you have some 300 test cases, then how many you choose for automation. what is criteria of selecting?
52. Get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456
53. Write a script to get the following result: username password frm the string1="A=username" string2="B=password"
54. A webPage has a ComboBox with 10 values in it. Write a script to select 4 vales from it using CTRL key
55. A web Page has 2 frames. Find out the number of weblist items in the second frame of the page.
56. A web Page has a webtable with four columns and four rows. The first column is of ID and has values of 100,100A,A100,100y Find out the number of rows whose ID starts with 100. Similarly the last column is 'number of links'. Each row in the last column has values like link1,link2,link3 etc Find out the number of links where id is 100
57. A dialog is diplays " Transaction 254689 has been successfully completed" How to get the transaction ID from the message ?
58. A web page title might be xxxx@xyz.com or xxxy@xxx.co or xyz@abc.in.Using what mandatory properties can be the page identified.Give the regular expression for that.
59. A web page has two butons with same properties and rotating in clockwise direction. how to click on any of the button?
60. Explain qtp framework by taking an example?
61. How do you invoke any application and write a script to invoke QTP using VB Script.
62. In A Table there are some columns and dynamic rows and in each row in first column there is a link with name. upon clicking on that link it will show some details. write the vbscript to check that link without descriptive programming?
63. how qtp will recognise if application is run on many browsers ?
64. We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we handle this scenario in QTP?
65. Given scenario is like this: One Web table is there and you have to search and retrieve a cell data which is equal to the given number say:123. Assume you have given with the column name/id of the table where the number may exist. So now you have to go to the given column and search for the number 123 and retrieve it along with the row number of it.
66. How to findout the number of spaces with in STRING For Ex : STRING is " QTPWorld IS A SOFTWARE ENGINEER "
67. Write the vb script to sort array in ascending and descending Order ?
68. How to retrive the number of spaces in a string ?
69. The string is like "Quick test profeSsional", write a script for this how to findout the number of "S" in the string ?
70. What type of challenges you have been faced in your project?
71. We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario
72. How to test menu options using qtp ?
73. Action1: I have a value "test" stored in a variable X. I want to use that variable X in Action2 .. how?
74. I Scheduled a QTP Script on remote desktop. Script is going to failure,when remote desktop connection fails.I have to open my remote desktop untile the scripts exection completes. If I disconnect my remote desktop connection, script is going to fail.?
75. How to call Datable values in the QTP program. exp: I have two parameters like Email id and Password this two i would like to add multiple entries in the datable to use it.
76. What is the difference between Gobal/Action datatable ?
77. What are the things will u consider to automate an application ?
78. I have a tool for automation testing (eg:qtp).I have two functionality(A & B) to test.A is tested once in a year. B is tested everyday. At present i have the money and resource availability to automate only one functionality.Which one will u suggest and why?
79. If 2 gmail browsers are opened in our system, how to enter the mail id and password into second browser by using discriptive program?
80. Can we write class for vb script in Quick Test Professional?
81. What is the difference between Mandatory and BaseFilter Properies ?
82. How to find Total no of Text Fields in the Page ?
83. What is a dynamic array ?
84. There is a table with 4 columns and 10 rows, how to write the script to display the first column records using qtp?
85. How many types of Check Point in QTP
86. Suppose there is a bitmap with some text in it how do you write the script to get the text.
87. What is the difference between Systemutil.run and Navigate?
88. What is the difference between low level recording and virtual object?
89. There is web page with the webtable,this contains some data, how do you manipulate the data.
90. How many types of parameters are there in QTP and what are they?
91. Difference between object identification and smart identification
92. Vb script for calling one function to the another function
93. How to recognize webtable using QTP and how to use it? -- How would one conclude that it is a web table ?
94. How to Extract a word from a sentenece?
95. How will you set a unique four digit number in an edit field in QTP?
96. Where do you define the objects as regular expression when you are using regular expressions.
97. How to find the OS name by using QTP script?
98. Example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?
99. In Login two edit box which object class property value is same, How to enter into 2nd edit box in qtp by vbscript.
100. How do function returns a value?How can we pass one function value to other function as input
101. Script to Open the Text file and Read the line
102. Script to Open the text file and read all the lines
103. Script to Compare Two Files
104. Script to write the files
105. Script through which Only One line in two files is compared
106. Script to Find whether a string exist in the file
107. Script to fetch all the values of a Weblist.
108. Script to Reverse the string without using strreverse function
109. How do we Access, retriew and edit the runtime objects in Automation Testing using QTP
110. How to load a object repository in QTP during runtime?
111. How to Add libraries in QTP during runtime?
112. How to make arguments optional in a function?
113. How can i open a file in Textpad and replace a string with another using QTP
114. Can a function return a dictionary object?
115. How to retrive XML file data in QTP using Script ?
116. Script to Close all the Browser
117. Script to Close All browser except First Browser
118. Script to Count the Number of Browsers Opened
119. Script to Get the File Names from the folder
120. What is testing process with QTP in organization?
121. If there are seven browsers with same name open. I want to close one particular browser thru QTP. how can I do this?
122. In web page there is five OK buttons available, while recording I click on 3rd OK button, How QTP identify the 3rd OK button while running script?
123. How do you export an output to a excel sheet? Ex: I get my answer by using Msgbox"..." &R. How do I displayed the result of the Msgbox (such as R) to an excel sheet?
124. If devloper change only button names in present build then script will execute or not , why?
125. How do you use the parameters.input parameters and out put parameters.
126. What are the environment variables,how do you use them. give an example.
127. What is the Difference Between Wait & Sync?
128. Difference Between Value & RawValue?
129. What is the script to select 2 or more than 2 options from a listbox.
130. What will be the test script in QTP to test a ComboBox where a user has to select more than two items?
131. Why do we use both location and index identifier?
132. How to handle recovery scenario for a application crash?
133. What is the difference between "call" and "callclose"?
134. How to compare source and target database in testing?
135. Suppose 3 excel sheets are there & we are trying to check for login credentials for a page. userid from excel1 , password is from excel2 whether the page is opened or not that checkpoint is result is should be stored in excel 3.
136. Is there any function or vbscript in QTP to clear the cookies,sessions?
137. What is exact difference between while and do while in QTP ?
138. I have 2 Environment variable which holds int. I called into my test and addedup. but output is concatenating the values instead of Sum. Ex. Envi("a")= 10, Envi("b") = 20, c= Envi("a")+ Envi("b"). msgbox c ( Ans.1020). How to overcome this pblm?
139. I am having a pop up validation browser which is 20 in number, i want to close those similar pop browsers one after the other, is there any specific code for that?
140. In a Web appl, on a page, there are student names & details listed.On clicking sort button,details are sorted on Names.How do u verify htat sorting is done by using QTP?
141. What is the difference between Action and Function.? when both has the same functionaltiy, when do we choose Action and when do we choose Function..?
142. How can we redirect QTP results in to a excel sheet after the execution
143. How to invoke QTP using Dos prompt ?
144. What is difference b/w AOM,DOM,COM Have u ever is used ny of the models.If so why?
145. HOW do we find a datasheet when there are 4 datasheets in data table.this question was asked by covansys interview.
146. What is the difference between Automation object model(AOM) and test object model(TOM)
147. How to capture screen shots when an error occurs?
148. How to export QTP results to an ".xls" file?
149. How to make arguments optional in a function?
150. What is qtp automation framework, what is the purpose of the framework and which folders included in this framework pls tell me with brief description
151. Will QTP Support Japanese Language?
152. If there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.
153. What is the command for taking valiue from a web table in qtp?
154. What is the diff between child objects and child items ?
155. Write vb script for factorial of number
156. Check if a string is alphanumeric or not
157. VB script for sorting of an array
158. What is Dif between Test parameters and action parameters ?
159. What are the Options displayed under debug view? (Watch,variable,command)
160. What is Difference between Step in , step out and step over ?
161. Explain Dim,Redim,Preserve with example.
162. What makes your project's framework a Hybrid framework? By looking at a framework can you tell what type of framework it is?
163. In a web-application, a web edit box is not allowing 'copy paste' option. You are suppose to enter the values with key presses. How to enter the values using QTP?
164. There is one parent browser and 'n' number of child browsers on desktop. Write a code to close all the child browsers but parent browser should not be closed.
165. There is a page with OrderID list and read-only Price object. Write a program to compare the price against a orderid. Select an order and check the price for it. The comparison data will be either in Excel or DB. I will be happy if you use DB.
166. How to find if given number is prime or not?
167. How to sort an array into descending order?
168. How to find duplicates in an array and remove them efficiently?
169. There is an array with 1-100 integers randomly arranged. One integer is missing. Find it efficiently.
170. What is the name of sorting algorithm. Anyone?
171. There is an array given to you as shown: (1,5,3,2,3) Find the missing element and the repeating element. It will repeat only once and only ele will be missing.
172. Webtable has a link, how to click it?
173. Webtalbe celll has userrname, firstname, lastname. Get only first name.
174. Regular expressions usages?
175. QTP+QTP=2QTP, count how many QTP are there.
176. How to access a variable during runtime
177. Difference between ChildObjects and childitems .
178. Difference between Relative and absolute path.
179. Use of dictionary objects and difference with arrays ?
180. How to convert a float to integer?
181. How to find out if its an array?
182. Can you convert US time to India time?
183. Diff between class and function?
184. Scripts are there in one computer, how to run them in another computer?
185. Reverse each word in a sentence.
186. Sort a list table
187. Write a script to print below pattern
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
188. How to check if a text box has +ve or -ve values?
189. Compare excel file data with Webtable
190. Print childobjects with print type
191. Import excel and print all values in datatable
192. Script to find numbers of hours from a given date?
193. How to find the file is a csv file?
194. If there are N number of Browsers opened on desktop and google.com is also one of the browser. A. How to count the number of Browsers Opened ? B. How to close all the browsers except google.com ?
195. Str="GOOGLE" ....How to reverse the string as "ELGOOG" without using STRreverse option .
196. If QTP unable to Identify the Object then How to identify the object without QTP Scripting ?
197. The Variables X=30 and Y=20 but how to swap the variables as X=20 and Y=30 without using a third variable?
198. Did you find anything in your project that QTP proved inefficient to perform?
199. What is Test Batch Runner?
200. How to retrieve data from application objects?
201. How to load vbs,env var,xml,objrep during runtime?