InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What are Virtual Objects? |
|
Answer» Sometime, QTP doesn’t recognize objects of an application that have been considered as standard objects for an application. QTP considers those objects as virtual objects and map them to standard classes, those objects can be a button or a check box. During run time, QTP copies the user's action on the virtual object and the result of the test displays the virtual object as a standard class object. |
|
| 2. |
What is descriptive programming in UFT means? |
|
Answer» Whenever, Object Repository grows, starts giving poor performance because of its increased size and UFT faces problem in identifying objects from object repository, descriptive programming (also known as Programmatic Description) provides a way to identifying objects and performing operations on objects that are not present in object repository. Descriptive programming includes property name and property value. It performs operation of objects of the application that are very dynamic, and to perform operation on the application at run-time without having the knowledge of object's unique properties. |
|
| 3. |
In UFT, how to get data from database? |
|
Answer» Follow the given below code to get data from database − Set db = createobject (“ADODB.Connection”)db.Open “Provider = Microsoft.Jet.OLEDB.4.0;Data Source=G:\guru99\vb6\admission_project.mdb;Persist Security Info = False”Set rst = createobject (“ADODB.Recordset”)rst.Open “select*from Course”, db, 3id = rst. RecordCountFor i = 0 to id-1 Print rst.field (0) & rst.fields (1) & rst.fields (2) & rst.fields (3) rst.MovenextNext |
|
| 4. |
Using UFT, how to send email from outlook? |
|
Answer» The given below code help in sending email from outlook − Set Outlook = CreateObject ("Outlook.Application")Dim Message 'As Outlook.MailItemSet Message = Outlook.CreateItem (olMailItem)With Message .Subject = Subject .HTMLBody = TextBody .Recipients.Add (aTo) Const olOriginator = 0 .SendEnd With
|
|
| 5. |
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» QTP doesn’t perform iterations based on local data sheet, it performs iterations based on Global data sheet, so that; the test iterate will be only once on global datasheet. |
|
| 6. |
What is the extension for a function library? |
|
Answer» The extension of a function library is “.QFL”. |
|
| 7. |
In UFT, what is the code to write data to text file? |
|
Answer» The correct syntax to write data to text file in UFT is − Content = “TutorialPointsTutorials”Set Fo = createobject ("Scripting.FilesystemObject")Set f = Fo.openTextFile ("c:\myFile.txt",8,true) ' open in write mode f.Write (contents) f.Close Set f = nothing
|
|
| 8. |
In UFT, what are the differences between qfl and vbs files? |
|
Answer» Difference between qfl and vbs files −
|
|
| 9. |
How Bitmap Check point is differ from Image Check point? |
|
Answer» In Bitmap checkpoint, user can compare two complete bitmaps as well as part of the bitmaps from a pixel to pixel. In Image checkpoint, user can only check the Image property values |
|
| 10. |
How many types of environment variables QTP supports? |
|
Answer» QTP supports three types of Environment variables −
The given below syntax used to retrieve the Environment Variable Environment.Value( "name") = "TutorialPoints" OREnvironment.Value( "OS") = " TutorialPoints" Whereas Environment.Value ("name") The syntax will return name as TutorialPoints Environment.Value ("OS") This will return your system OS |
|
| 11. |
In UFT, what are the ways to export datatable to excel? |
|
Answer» There are two ways to export data-table to excel −
|
|
| 12. |
In UFT, How to get total number of rows of the webtable? |
|
Answer» UFT provides three ways to get the count of rows from the webtable.
|
|
| 13. |
What is the Action Conversion Tool? |
|
Answer» It is a standard built-in tool delivered by QTP to convert Actions into Business Process Components. |
|
| 14. |
How to create TSR file in UFT? |
|
Answer» TSR stands for Test Shared Repository, used to share object repositories. Follow the given below steps to generate TSR file − First, open object repository, and then go to file menu. Next, export local objects option and select it. UFT will open dialog box to save.tsr file; give the desired path to save the file. The above steps will generate the .tsr file in UFT. |
|
| 15. |
In UFT, how to write data to excel file? |
|
Answer» The correct syntax to write data to excel file in UFT is − filepath = “C:\Bugs\Reports.xlsx”Set objExcel = CreateObject(“Excel.Application”)objExcel.Visible = TrueSet Wb= objExcel.Workbooks.Open (filepath)Wb.worksheets(1).Cells(1,1).Value = “TutorialPoints” read value from Excel file |
|
| 16. |
In QTP, what is the standard timing delay for web based application? |
|
Answer» The standard timing delay for web based application is 60 second that can be changed by Test Settings dialog box. |
|
| 17. |
What is SetToProperty? |
|
Answer» SetToProperty is a standard method of QTP that temporarily changes the property of an object stored in the Object Repository. |
|
| 18. |
How to import/export xls into QTP? |
|
Answer» Syntax to import xls into QTP − DataTable.ImportSheet "..\..\TestData\Input.xls",1,dtGlobalSheetSyntax to export xls into QTP,DataTable.ExportSheet "..\..\Results\Output.xls","Global" |
|
| 19. |
In your system, can you open two instance of QTP to work for? |
|
Answer» No! We can’t open two instance of QTP in a single machine to work for, but QTP itself can work on multiple instances of the Application Under Test (AUT) and handles multiple IE browser windows simultaneously. |
|
| 20. |
Using QTP, how to export a Script from one PC to another? |
|
Answer» You can create a ZIP file of the scripts into your source computer that can be imported into QTP’s destination computer by using the "Generate Script" function. To avail this function, go to the Object Identification Test Settings Tools/Options tab. |
|
| 21. |
What is GetRoProperty? |
|
Answer» GetRoProperty is a standard method of QTP that fetches property values of a run -time object. |
|
| 22. |
In QTP, how to declare a variable? |
|
Answer» Use DIM keyword before a variable name to declare a variable and use SET keyword before a variable name to assign value to the variable For Example “Dim weight”, here DIM keyword is used to declare weight variable.Set weight = 40, here SET keyword is used to assign value “40” to the weight variable. |
|
| 23. |
What is the difference between functions and actions in QTP? |
|
Answer» In QTP, Actions are written VB scripting language which doesn’t return any values. Functions are written VB scripting language which returns single value. Every Action contains its own Object Repository, Data table, Active screen, etc where as function does not. Function can be called in action, but action can’t be called in function. In QTP, functions are saved with ".vbs" extention where as actions are saved with ".mts" extension. Action is internal to QTP whereas Function is just lines of code with some/none parameters and a single return value. Actions are sometime reusable but sometime not whereas functions are always reusable. |
|
| 24. |
How can you handle exceptions in QTP? |
|
Answer» In QTP, exceptions can be handled by using “recovery scenarios” and “On Error” statements. To handle the exception in recovery scenario, you have to define three things −
To handle the exception by “On Error” statements – In the script, you have to use the “On Error Resume Next” and “On Error Go to 0” statement. |
|
| 25. |
What is the difference between check point and output value? |
|
Answer» Check point is a verification point that generates a PASS or FAIL status by comparing a specified property the current value and the expected value. An output value is a value recorded while running a test and can be stored in a particular location like; either in a Datatable or in a variable. Unlike Checkpoints, it doesn’t compare two values to generate PASS/FAIL status. |
|
| 26. |
What is a Run-Time Data Table, where to find and view this table in QTP? |
|
Answer» The Run-time data table stores values, like; parameterized output, checkpoint values, output values, etc. It presents it-self with “xls” file extension and store it-self in the Test Results Folder. User can also access it from the Test Fusion Report. |
|
| 27. |
What is Test Fusion Report? |
|
Answer» Test Fusion Report presents all features of a test application that comes in use while running the test. Test Fusion Report presents it-self as an organized tabular format. Also, it gives details of each and every step of the iterations, run-time data table and movie of the test run if selected. |
|
| 28. |
How to call an action to another action? |
|
Answer» An action can be called in two ways − Call to COPY of an Action: While copping the action (reusable and non-reusable actions), the action also copies checkpoints, parameterization, and the corresponding action tab in the Data Table of the calling test. In the Data Table of the calling test, you can do the modification to the copied action that modification would not give any affect to the other tests. Call to an EXISTING Action: Here, You can make a call only to the "Reusable" actions. In the calling test, calls to an existing action will be in read-only mode. They can only be modified in the test in which they were created. It is easily manageable and can be used the same action in several test. |
|
| 29. |
What is Step Generator? |
|
Answer» Step Generator adds steps to the test scripts with recording any process. |
|
| 30. |
Explain the Text output value used in QTP? |
|
Answer» During runtime of the test, Text Output values capture text display on the application. In parameterization, text output values capture values display on each iteration, those values will be stored in the run-time data table for further help. |
|
| 31. |
How Automation Object Model works in QTP? |
|
Answer» QTP Automation Object model completely deals with the automation process happens in QTP. Usually, QTP Automation Object model represents all configuration and functionality provided by QTP test. Almost all, QTP dialog boxes contains their corresponding automation object which can edited or regained by their corresponding properties or methods presented in Automation Object Model. User can use Automation Objects with standard VB programming elements (iterative loops or conditional statements) to design a desired script. |
|
| 32. |
What is Reporter.ReportEvent? |
|
Answer» Although, QTP provides four types of result status; Pass, Fail, Done, and Waiting, a standard method of QTP “Reporter.Reportevent” sends custom messages to the test results window. “Reporter.Reportevent” can also send screenshot of result status to the test result window. Syntax Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath] Whereas EventStatus = 0 or micPass, 1 or micFail, 2 or micDone, and 3 or micWarning ReportStepName = (String) Name of the intended step in the report (object name). Details = (String) Description of the report event. The string will be displayed in the step details frame in the report. |
|
| 33. |
In QTP, how to check the broken links of a web application? |
|
Answer» The Page Checkpoint in QTP displays numbers of count of valid/invalid link present in a page. |
|
| 34. |
How many types of Test Automation Frameworks are there in QTP? |
|
Answer» The types of Automation Frameworks are −
|
|
| 35. |
What is an Optional Step? |
|
Answer» If a step declared as an optional, QTP thinks that the step is not mandatory to execute. If an optional step contains GUI objects, QTP executes that step. If an optional step doesn’t contain GUI objects, QTP avoids the optional step and move to the next step. |
|
| 36. |
What is the extension of the code file? |
|
Answer» The extension of the Code file is script.mts. |
|
| 37. |
What is Object Spy, explain it? |
|
Answer» During test or descriptive programming, object spy facilitates to identify & get the run & test time object properties & methods of the application. It can be access either directly from the toolbar or from the object repository. |
|
| 38. |
How would you connect to database using vbscript ? |
|
Answer» Although, QTP doesn’t give any built-in support to the database connectivity, VBScript language and ADODB objects helps in database connectivity. There are certain things that must be known before connectivity −
To connect to the database, either; you can code the database connectivity command directly or you can use the SQLQuery tool provided by QTP. |
|
| 39. |
What is keyword view and Expert view in QTP? |
|
Answer» Keyword View is an icon based view, displays test steps in tabular format and automatically creates documentation for the test steps. Expert View gives the corresponding VB Script statement for every test step in the Keyword view. |
|
| 40. |
Explain the types of recording modes in QTP and how to use them? |
|
Answer» There are 3 types of recording mode that QTP supports −
Normal recording mode: A default recording mode which has been used in most of the automation activities. By using QTP's Test Object Model, it recognizes objects apart from their location on screen. Low-level recording mode: In this mode, operation of mouse in x, y co-ordinates helps in recording the objects. It is capable in testing hashmaps and recording objects that can’t be identified by normal recording mode. Analog recording mode: This recording mode records screen/application window on the basis of mouse and keyboard operations. It records the operations, like; drawing a picture, recording signature, drag and drop operations. |
|
| 41. |
What are the drawbacks of QTP? |
|
Answer» There are many drawbacks of QTP −
|
|
| 42. |
What is QTP batch testing tool? |
|
Answer» Execution of multiple test files (or series of files) together at a same time is known a batch testing. To execute the batch testing, QTP provides a tool “Batch Test Runner”. To function multiple files together in a tool, you just need to add a script of the test. After adding script, you don’t need to do anything manually, tool will automatically start opening and executing the test script one after the other. |
|
| 43. |
Explain how QTP uniquely identifies the GUI objects? |
|
Answer» In QTP, object’s properties help in identifying the GUI object. During recording, the object repository of the GUI objects stores the properties that have been defined in the Object Identification settings and while running the test, QTP compares the properties that have been stored in the object repository of the GUI objects with the on-screen properties to uniquely recognize the GUI object. |
|
| 44. |
Is it possible to switch from Local and Shared Object Repository? |
|
Answer» Yes! User can switch from local to share object repository by opening QTP window, going to Test Settings Resources (provide an option to choose repositories). |
|
| 45. |
What is round function in UFT? |
|
Answer» Round function in UFT is used to round the decimal value For example Mydecimal = 8.2755555Roundedvalue = Round(Mydecimal , 5)Print roundedvalue ‘it will print 8.275 |
|
| 46. |
What is “settoproperty” and where to use it in UFT? |
|
Answer» Settoproperty stands for set test object property. Using this property, you can temporarily change the object values and its corresponding property value at runtime. |
|
| 47. |
What are the types of Automation Framework in UFT? |
|
Answer» Types of Automation Framework in UFT −
|
|
| 48. |
How to connect to QC in UFT? |
|
Answer» Directly, you can connect to QC from UFT GUI window. To do so −
Give above steps will facilitate you to connect to QC, later on you can execute the tests from QC itself. |
|
| 49. |
How to execute Cross platform testing and Cross browser testing in QTP? |
|
Answer» Cross platform testing and Cross browser testing can be possible by creating different actions in terms of different operating systems and Browsers. Cross Platform Testing: The built-in Environment Variable helps in excavating-up the OS information. You can call the action based on the platform where the action have been recorded. Cross Browser Testing: The code; Browser ("Core Values").GetROProperty ("version") helps in extracting the browser and its corresponding version, for example; IE 6, Mozilla Firefox 9 or Netscape 5. After extracting the browser, you can call the actions relevant to the particular browser. |
|
| 50. |
How to manage Java tree in QTP? |
|
Answer» First, open QTP by selecting Java add-in, then perform the recording operation on the Java tree. If, you are not getting proper recording environment, then in the opened QTP tool, go to Tools Object Identification Java. In the tree objects make changes in compulsory and assistive properties to facilitate identification. |
|