# UFT Interview Questions and Answers – Guaranteed Success Guide for 2020-21

Now-a-days, the demands of test automations are getting increased rapidly to save time and money. Many tools are available to automate the software testing process in the IT industries. But, if we consider the different aspects like the flexibility of scripting, easy maintenance, rapid development, then we have to choose the Unified Functional Testing(UFT) tool, which was previously known as Quick Test Professional (QTP).

Through out this “UFT Interview Questions and Answers article”, we are going to show case the frequently asked UFT Questions and answers which will gives you more exposures for UFT Interviews. The UFT Interview Questions and Answers article will also help to get the preparation to face UFT job interviews.

## Top UFT Interview Questions and Answers

Q1. What is Software Testing?

Ans: Testing is a process to check the readiness of the end product with expected quality. There are multiple levels of testing are defined throughout the software development process. The software testing can be done through manual or automated process.

Q2. Why is testing required?

Ans: Purposes of testing –

• Ensure the quality of software products.
• Identify issues or break in an application before the production deployment.
• Ensure all the business requirements are fulfilled.
• Identify if there are any performance issues.

Q3. What are the various testing approaches?

Ans: Different types of testing are specified below –

Unit Testing – Done by the developer during the software development phase.

Integration Testing – It is done by the tester during the integration phase of different software components.

System Testing – It’s done to ensure the overall quality of the software products after completion of integration testing.

Integration Testing – This is done after the integration of different components/subsystems for any application.

User Acceptance Testing – It is done by the receiver of the product to check the fulfillment of all the requirements.

Regressing Testing – This done to check the business as usual processes of the application after any major or minor code drop.

Q4. What is automation testing?

Ans: Nowadays, there is a big opportunity for software testing to be done fast and efficiently with proper quality assurance. So, the test automation is the perfect solution which means testing can be done through tools/robots to reduce the efforts and increase the effectiveness.

Q5. Why automated testing is so important?

Ans: The importance of automation testing are –

• Fast test execution cycle.
• Avoid human errors during testing.
• Reduce the manual test execution efforts.
• Reduce the time of the overall software release cycle.
• More test coverage ensures better software quality.
• Parallel execution can be possible.

Q6. What are the major automated testing tools available in the market?

Ans:  The major tools which are available in the market are – UFT, Selenium, RFT, Tosca, etc.

Q7. What is the full form of QTP, UFT, ALM, QC?

Ans:

QTP – Quick Test Professional

UFT – Unified Functional Testing

QC – Quality Centre

ALM – Application Lifecycle Manager

Q8. Explain the merits of UFT tool?

Ans: The merits of UFT are mentioned below –

• Easy to automate and learn the tool.
• An automated test case can be developed by recording any test scenarios.
• An object identification process or approach is easy and more effective.
• It supports all the standard automation test frameworks.
• Automation of major application platforms (e.g., SAP, Web, SFDC, window, mobile, etc.) are possibles.
• Web service testing is possible also supports XML.
• It follows VBScripting for writing test cases, which is easy and simple.
• Easy to embed with test management tool ALM.
• It supports data tables and excels, which will help to parameterize the test data easily.
• It provides a default test reports with export features.

Q9. What is automation test frameworks? Explain the benefits?

Ans: Automation test framework is a set of technical rules or guidelines to automate test cases in an organized and effective way. The benefits of the implementation of test frameworks are –

• Follow the same guideline throughout the test case developments.
• Enhanced the speed of different automation testing process.
• Easy to maintenance.
• The application can be tested accurately.
• Continuous testing can be possible.
• Better readability of the test suite.

Q10. Explain the concepts of different test frameworks? Which test frameworks are commonly used, and why?

Ans: The standard automation testframeworks are –

Linear Automation Framework – This is also known as Record and Playback framework as it’s generated during the recording. Test data parameterization, script reusability concepts are not used here. Due to this, we can create test cases quickly. This framework is not suitable for the long run.

Modular Driven Framework – As per this Framework, the tester can break the entire application into small modular test scripts based on the smallest part of requirements. After the creation of modules, the tester can develop the test cases based on the small modules.

Due to the usages of modules, script maintenance is easier than compare the Linear automation framework. This approach is helpful for distributed applications where multiple test flow is available.

Data-Driven Framework – In this framework, the test cases are created based on the test data. It means, test data drives the test cases. The test data is fetched from the external sources such as Excel, CSV files, databases, etc., and they are loaded in variables. As data is parametrized, so the same test case can be used to test multiple scenarios based on different data set. It reduces the number of test cases.

Keyword Driven Framework – It is also known as table-driven testing. The automation test scripts are developed based on the keywords which are mentioned in the excel sheet. Each keyword is referring to small script modules. The keyword-driven framework is ideal for small test projects. Here, a single keyword can be reused in multiple test cases.

Hybrid Test Framework – This type of frameworks are defined by referring the concepts of more than one standard test automation frameworks. This framework is commonly used for test automation. Based on the test applications, the different suitable frameworks are identified and combined to develop hybrid frameworks.

Q11. What are the different components of UFT?

Ans: Primary components are mentioned below –

Actions – This the scripting area where actual codes are written here.

DataTables – Use to keep the test data.

Object Repository – This is a collection of technical information(properties) of test objects.

Function library – All the functions are kept here.

Environment Variable – Use to define the framework configuration, application platform-related data, which can be used throughout the entire test suite.

Q12. What is Action? Explain the classifications?

Ans: Action is basically acted as a container where we can write our test scripts. Through the action, we can break the entire functionalities into small logical steps/modules. Every script should contain at least one. But we can create/refer multiple actions based on the requirements. There are two types of actions available –

Non-Reusable Actions: This type of action can be called in the same script only.

Reusable Actions:  This type of actions can be linked from external UFT test cases.

Q13. What are reusable actions? Explain the purpose.

Ans: This is one kind of action that can be reused from multiple test scripts. It provides the reusable feature of UFT. While creating actions, we need to check the reusable checkbox to make it reusable actions. After that, we can call it from other test scripts by following the option “Call to an Existing Action” for linking or “Call to Copy of an Action” for copying the reusable actions.

It’s mainly used for script reusability purposes to reduce the no of test cases. Indirectly, it will help for better script reusability.

Q14. Explain the main difference between local and reusable actions?

Ans: The scope of local action is restricted to with in the same test case, but the reusable actions can be used from the external test cases.

Local actions are used for building the logic of a particular test scenario, but reusable actions are developed as a module to cover the common functionalities that can be reused.

Q15. What are the different parts of actions? Explain.

Ans: The major parts of actions are –

Scripting Area – It’s used to write the scripts.

Local Object Repository – Contains the objects which can be used in the scripting area of that action.

Local DataTable – It contains the test data which can be used in that particular action.

Properties – The input/ output parameters can be defined here.

Q16. Explain the differences between UFT script view and the keyword view?

Ans: In the scripting view, we need to write the logic as a script. But in the keyword view, we can view the scripts as a keyword and can be modified by selecting the configuration.

Q17. How can we create a reusable action?

Ans: While creating actions, we need to check the reusable checkbox to make it reusable actions.

Q18. What is an object repository? Explain the purpose of it.

Ans: The Object repository (OR) is the collection of technical information(properties) for the test objects which is used to map the application with the test case. Basically, different types of properties of the application fields are stored in OR as an object. The properties are used to uniquely identify the test object. It is advisable to follow the below sequence of object identification mechanism through the OR –

Mandatory property -> Assistive property -> Ordinal Identifier -> Smart Identification

Q19. Explain the classifications of OR?

Ans: The OR is classified into two categories –

Local Object repository – The scope of local object repository is restricted to with in the same action. The local OR is created as mtr file within the test folder.

Shared Object repository – The shared object repository can be access from multiple actions and test cases. The shared object repository can be defined with the help of object repository manager utility. It is created with the tsr file extension.

Q20. Explain the ideal framework to use a common object repository?

Ans: The common object repository component of UFT is ideal for keyword driven, modular and hybrid frameworks.

Q21. What is the .tsr file?

Ans: Shared object repositories are saved as .tsr file.

Q22. What is the .mtr file in UFT?

Ans: Local object repositories are saved as .mtr file.

Q23. Explain the different components of the object repository?

Ans: Different parts of the object repository are –

Object Finder – It’s used to inspect or analyze the technical properties of test objects at any point of time.

Add Object – Any object an be inserted into the repository through this option.

Update from the application – This option allows us to update the properties for the existing objects with the reference of the application.

Highlight – It allows to highlight the selected object in the application.

Locate in Repository – It allows us to locate the object in object repository from the application.

Object Properties section – Different types of object properties can be viewed/edited from this section. The properties includes mandatory properties, ordinal identifier, smart identification, etc.

Q24. Explain the object identification mechanism in UFT?

Ans: The test objects can be identified based on the technical properties which are defined during the application development or the behaviors during the appearances. The UFT uses some mechanisms to identify objects which are explained below –

• Descriptive Properties – The technical properties of test objects which are defined during the application development, are treated as descriptive properties in UFT. This properties should be the first choice for object recognition. The descriptive properties are the combination of mandatory and assistive properties. If the mandatory properties fail to identify any object uniquely, we need to go for the assistive properties for object recognition.
• Ordinal Identifier – We need to use the ordinal identifier while both the descriptive properties are not able to identify the object. The ordinal identifiers are defined by the UFT based on the appearance, location of the test objects. Three types of ordinal identifiers are available in UFT –

Index – It’s defined based on the appearance of the test object. The index value for the first occurrence of the object is always starts with zero.

Location – It’s defined based on the location of the test object. The location value for the first occurrence of the object is always starts with zero.

CreationTime – It’s defined based on the creation time of the test object. The creationtime value is always starts with zero.

• Smart Identification – When both the above mentioned approaches are failed, the UFT is trying to identify the test object based on some pre-configures additional properties. This approach is known as smart identification. It should be the last option for object identification. This approach is applied to objects which are available in OR if we select the “Smart Identification” value as true. As per the best practice, we should disable it as it slow down the test execution.

Q25. What is an ordinal identifier?

Ans: We need to use the ordinal identifier while the descriptive properties are not able to identify the object. The ordinal identifiers are defined by the UFT based on the appearance, location of the test objects. Three types of ordinal identifiers are available in UFT –

Index – It’s defined based on the appearance of the test object. The index value for the first occurrence of the object is always starts with zero.

Location – It’s defined based on the location of the test object. The location value for the first occurrence of the object is always starts with zero.

CreationTime – It’s defined based on the creation time of the test object. The creationtime value is always starts with zero.

Q26. What is Smart Identification?

Ans: When both the descriptive properties and ordinal identifiers are failed, the UFT is trying to identify the test object based on some pre-configures additional properties. This approach is known as smart identification. It should be the last option for object identification. This approach is applied to objects which are available in OR if we select the “Smart Identification” value as true. As per the best practice, we should disable it as it slow down the test execution.

Q27. What is descriptive programming?

Ans:  This is an alternative approach to identify object with out using object repository. In this approach, the description(identification properties) of the test object, has to provide as a string at the time of test execution. The descriptive programming helps in below use cases –

• When the test objects are dynamic in nature.
• When we need to avoid object repository i.e. develop functional scripts through functions.
• Improve the execution speed.
• When working with similar types of multiple objects.

Q28. Explain the types of descriptive programming approach?

Ans: Two approaches are available to use descriptive programming –

• Description Objects – Using the Description object, the the properties can defined and passed during test execution. Example –
• Description Strings – In this approach, the all properties are passed as string during execution. Example –
Browser("MyApp").Page("MyApp").Link("text:=login","type:=Link").Click

Q29. What is the purpose of descriptive programming?

The purposes of descriptive programming are –

• When the test objects are dynamic in nature.
• When we need to avoid object repository i.e. develop functional scripts through functions.
• Improve the execution speed.
• When working with similar types of multiple objects.

Q30. Explain the differences among descriptive programming and object repository approaches?

Ans:

Q31. Explain the best practices used for object identification?

Ans: The common best practices are –

• The logical names in the object repository should be self explanatory of test objects.
• Disable the smart identification to increase the execution performance.
• Big object repositories should not be used as it decrease the performance. The descriptive programming is useful in this condition.
• Use regular expression to handle dynamic objects. Even descriptive programming approach can be used here.
• Use shared object repository for reusability.
• Avoid use of duplicate objects in the object repository.

Q32. How to handle dynamic objects in UFT?

Ans: We can use either of the below approach to handle dynamic objects in UFT –

• Descriptive programming approach – We have already discussed this in previous questions.
• Regular Expression – UFT allows to define patterns with the use of characters to identify any test objects which follow the same patterns. The series of characters i.e. the patterns can be use by replacing the dynamic part of the test objects. Example –

By analyzing the link with visible text as – “Business date is 05-12-2021”, we conclude that the “Business date is “ part is static but the remain part is dynamic which will change every day. So, to handle this dynamic object, we can use any of the below patterns while defining the “text” property in the object repository –

Business date is .*” – Here ‘.*’ denotes any string values without any restriction for length.

Business date is \d\d-\d\d-\d\d\d\d” – Here ‘\d’ denotes any numeric digit.

Q33. What is a virtual object? Why did it use?

Ans: The virtual object is used when the test object is not compatible with UFT i.e. object is not getting recognized. The virtual object feature allows to define this kind of objects as link, textbox, button, etc. based on their appearances.

The virtual object wizard can be opened from the UFT menu – “Tools-> Virtual Object->New Virtual Object.” After opening the wizard, the virtual objects can be defined by following the instructions appear in the wizard.

Q34. Explain the approach to create shared object repository from local?

Ans: The conversion approaches are –

• Export local into shared object repository (File -> Export Local Objects) from the Object Repository window.
• Drag-drop(cut-paste) the objects from local to shared object repository.

Q35. What is an object Finder? Why is it used?

Ans: This is very helpful while working with objects. The object Finder is used to inspect or analyze the technical properties of test objects at any point of time. Based on the analysis, it will be very easy to plan and design the object recognition methods to create the object repository. Also, it helps to investigate and identify the route cause for object related issues.

For description programming, object Finder is used to capture the technical properties for the test objects.

Q36. What is a regular expression?

• Ans: UFT allows to define patterns with the use of characters to identify any test objects which follow the same patterns. This patterns are known regular expression. The series of characters i.e. the patterns can be use by replacing the dynamic part of the test objects. Example –

By analyzing the link with visible text as – “Business date is 05-12-2021”, we conclude that the “Business date is “ part is static but the remain part is dynamic which will change every day. So, to handle this dynamic object, we can use any of the below patterns while defining the “text” property in the object repository –

Business date is .*” – Here ‘.*’ denotes any string values without any restriction for length.

Business date is \d\d-\d\d-\d\d\d\d” – Here ‘\d’ denotes any numeric digit.

Q37. How to get the count of links which are available in a web page?

Ans: We can do this using the below descriptive programming approach with child object–

Q38. What is ChildObjects?

Ans: This method is used in description programming approach. Based on the description, the method ChildObjects returns a list of matched objects. Please refer last question for example.

Q39. What are ChildItem?

Ans: When working with the table objects, the ChildItem method is used to interact with embed objects with in table cell. It will help to perform operations such as click, getRoProperty, etc. The syntax for usage –

testTableObject.ChildItem(row,col,mic_class,index).Click

testTableObject – Indicates a table object.

row – Indicates table row number.

col – Indicates table column number.

mic_class – Refers type of the embedded object like Link, Button, etc.

index – Refers the occurrence of the embedded object. It always starts from zero.

Q40. How can we associate a shared object repository in action?

Ans: Two options are available –

• Right-click on the node which represents the action name from the UFT solution explorer section.
• Choose the option “Associate Repository” with Action to open Shared Object Repository dialog box.
• Now, choose the correct shared object repository file and click Open to associate it.

Q41. Explain the main difference of “call to copy of action” with respect to “call to existing action”?

Ans:

call to copy of action  – It will copy the entire reusable action into the working test script as local action. So any change in reusable action will not be reflected here.

Call to existing action  – It will link the reusable action from the working test script as local action. So any change in reusable action will be reflected here.

Q42. What is “Object Repository Manager”?

Ans: It’s use to manipulate shared object repository. It allows to add, modify, remove of test objects from the repository. The object repository manager window can be opened from UFT menu –

Resources -> Object Repository Manager.

Q43. What is the purpose of the “Object Repository Comparision Tool”?

Ans: This tool is used for comparison between two tsr files i.e. shared object repositories. After the comparison, it will identify the mismatches. It can be opened from “Object Repository Manager” by the following path – “Tools->Object repository Comparision Tool.”

Q44. What is the purpose of the “Object Repository Merge Tool”?

Ans: This is used to merge two shared object repository into one. It can be opened from “Object Repository Manager” by the following path – “Tools->Object repository Merge Tool.”

Q45. Explains the action parameters?

Ans: The action parameters are acted as arguments for the UFT action. The main purpose of action parameters is to pass the input values to action and receive the output from the action.

It can be configured from the action properties section. Two types of action parameters can be created which are –

Input Parameter – It’s used to pass input data to the action.

Output Parameter – It’s used to receive output data from the action.

Q46. How to pass data using input action parameters?

Ans: The input action parameters value can be passed through input parameters into the child action. Example –

RunAction “childAction“, oneIteration,ipValu1,ipValu2, opValue

Here, input data are passed through the variables ipValu1 and ipValu2 into the child action. The input parameters are paramValue1 and paramValue2. The input parameters can be read from the child action using expressions Parameter(“paramValu1”) and Parameter(“paramValu2”).

Q47. How can we read the value of output parameters from the main action?

Ans: The output action value can be return through output parameters from the child action. Example –

RunAction “childAction“, oneIteration,ipValu1,ipValu2, opValue

Here opValue is the variable that receives the value of output parameter from the child action.

Q48. How can we click on a link available on a webtable?

Ans: We can click on a link available in a webtable using the childitem method. Example –

Set tableObject = Browser(“SampleApp”).Page(“SampleApp”).WebTable(“MyTable”)

tableObject.ChildItem(row_num,col_num,micClass,index).Click

row_num – row number of the table.

col_num –It represents the column index of the table.

micClass – Object type such as Link, Button, etc.

Index – occurrence of the object type in the particular cell. Index value starts with numeric 0.

Q49. What are the different options are available if a particular object is not getting identified by UFT?

Ans: Different available options are –

• Use of virtual objects.
• Perform low-level recording, and we can click on based on the co-ordinates.

Q50. Explain the best practices to work with actions?

Ans: The common best practices are –

• Give a proper action name.
• Use action parameters to work with dynamic test data that are generated during execution.
• Use data table or external excel sheets for test data.
• Use of shared repository instead of local object repository.
• Use reusable actions for unit functions.

Q51. What are the functions of UFT?

Ans: Function is a collection of statements to perform specific task. In UFT, we can write any conditional, logical, looping statements in function through vbscripting. Also, we can write scripts with the help of shared objects repository in functions. Functions are written in function libraries, which are stored in external paths. To work with functions, we need to associate the corresponding functional library with our test scripts.

Using a combination of functions and a shared object repository, we can replace our reusable actions.

Q52. What are the differences between UFT functions and UFT actions?

Ans: The differences are –

• Action has the own local object repository and datatable. But function does not have that.
• It is not possible to execute the functions as a standalone component which is possible for UFT actions. The function should be use with in actions.
• The function is easy to maintain in comparison to actions.
• By using multiple reusable actions, execution performance may be reduced. Execution performance may be increased by using of function library.
• We can not develop test scripts without using at least one action. But the function library is not an essential component of UFT.

Q53. What are the environmental variables? Explain the classifications?

Ans: This features is used for test data parameterization in UFT. The test data which are applicable across the entire test suite, are stored in the environment variables such as, application URL, Report Path, Test Environment name, etc. The structure to use environment variables is Environment.Value(“param_name”). It can be viewed from Environment tab which is available in “Test Settings” wizard.

The environment variables in UFT are classified into below two categories –

Built-in: The built-in environment variables are pre-defined by the UFT which are used to keep the tool and test related information such as, TestName, OS, OS Version, etc. This variables are read-only and can be accessible from entire test suites.

User-Defined: The UFT allows us to create environment variables based on the requirement which are known as user-defined environment variables. Again, two types of user-defined environment variables are available which are –

• Internal – The scope of this types of variables are specific to the individual test cases only. From the Environment tab of setting wizard, the user-defined internal environment variables can be created, modified or deleted. Also, it can be defined during the execution as well with the expression Environment.Value(“param_name”)=”Some value”.
• External – This kind of user-defined environment variables are defined in a XML file which need to be attached with UFT to access the individual variables. The external variables can be access through out the suite as read-only.

Q54. What are the limitations of virtual objects?

Ans: Limitations are –

• The virtual objects can not be created through recording.
• It can not be used with Checkpoints.
• We can not analyze the virtual objects using object Finder.
• It’s depends on screen resolution.

Q55. What are the limitations of the function library?

Ans: The limitations of a functional library are –

• The function library does not have an object repository and datatables.
• Execution of function is not possible from Function library. It should be referred from Actions to execute.
• The function libraries are the optional component.
• It works with shared object repository or descriptive programming to develop functional script through funtions.

Q56. What is datatable? Explain the different types of datatables?

Ans: Datatable is one of the most important components of UFT. It’s similar to Microsoft Excel, which is used to store data and feed the same in test scripts. Based on the data available in different rows of datatable, we can execute the test cases in a loop. Read/ Write both the operations are possible during execution.

The UFT datatables are classified into two types –

• Local datatable – The every action is built with a default datatable, which is know as local datatable. The scope is available through out the test case. The expressions to access any specific parameter item from the datatable –

DataTable.Value(“paramItem1”,dtLocalSheet) or DataTable.Value(“paramItem1”,”SheetName”)

Here, dtLocalSheet indicates the default local datatable available within the action.

• Global datatable – The every test case is built with a default datatable, which is know as global datatable. The scope is available through out the test case. The expressions to access any specific parameter item from the global datatable –

DataTable.Value(“paramItem”,dtGlobalSheet) or DataTable.Value(“paramItem”,Global)

Q57. Explain the syntax to read or write data in datatables?

Ans: In this example, we will see how to copy data from one cell to another cell in UFT datatable.

//Set or select the second row of the datatable
DataTable.GetSheet(“mainAction”).SetRowCount(2)
//Copy from Param1 to Param2 using a temp variable
tempVariable = DataTable.value(“Param1”,“mainAction”)
DataTable.value(“Param2”,“mainAction”) = tempVariable


Q58. What is an active screen? Explain the purposes.

Ans: The Active Screen pane allows us to view snapshots of test application as it is displayed during recording time.

We can add steps, checkpoint after running the test by right-clicking in the Active, without opening your application. Also, it can be used as a reference for the test object in the future for any test failure.

Q59. What is the recovery scenario? Explain the purposes.

Ans: A recovery scenario is an approach to control any unexpected events or errors which can appear at the run time. The “Recovery Scenario Manager” wizard is used for working with recovery scenarios. The wizard is available in UFT menu option “Resources → Recovery Scenario Manager.”

Through the recovery scenarios, we can handle either of the below-triggering points, which are the root causes of errors –

• Errors for un-handled pop-up windows.
• Errors related to Object State
• Error during Test Run
• Application Crash

The main purpose of the recovery scenario is to handle all types of unexpected errors and perform some predefined tasks based on the error types.

Q60. How to develop a recovery scenario?

Ans:  We can define recovery scenarios through the Recovery Scenario Manager through the navigation “Resources → Recovery Scenario Manager.” While developing the recovery scenarios, some configurations need to be done through the Recovery Scenario Manager. The configurations are Triggering Event, Recovery operations, and Post-Recovery Test Run Options.

Q61.Which programming language is followed by UFT for scripting?

Ans: VBScripting is used.

Q62. Write the conditional structure in UFT scripting?

Ans: Different Conditions in UFT are –

If-Else Statements:

If condition then

//statements for valid conditions

Else

//statements for invalid conditions

End If

Switch Statements:

Select Case expression

Case expression 1

statement

….

Case expression 2

statement

….

Case Else

writ the else statement

….

End Select

Q63. Explain the different types of loop structures available in UFT?

Ans: Different looping structures are –

• For loop
• Do While loop
• While Loop
• Looping based on entries in datatable by configuring the run settings.

Q64. What are the different kinds of application platforms supported by UFT?

Ans: Major UFT Supported application platforms are – SAP, HTML, Delphi, Powerbuilder, Java, dotNet, Oracle Apps, PeopleSoft, WPF, Webservice, VB, Siebel, Mobile Devices, Terminal Emulator, etc.

Q65. What are the prerequisites required to automate SAP application?

Ans: Prerequisites for SAP automation are –

• Enable scripting parameters through tcode rz11.
• Enable scripting from Client option settings.

Q66. How can we import or export excel in datatables?

Ans: Import Excel sheet:

DataTable.ImportSheet excelFile, sourceSheet, destSheet

excelFile – Represents the excel file which is available in external location.

sourceSheet – Represents the name of the excel sheet which will be imported.

destSheet – Represents the datatable name to store the external excel data.

Export Datatable:

DataTable.ExportSheet excelFile, sourceSheet, destSheet

excelFile – Represents the excel file name which which will be created in external location.

sourceSheet – Represents the name of the datatable which will be exported.

destSheet(Optional) – Represents the external excel sheet name.

Q67. What configuration do we need to create to run the test case in a loop based on the entries in datatable?

Ans: Open the test setting window from the navigation “File->Setting” and select the Run tab. In this section, by selecting either “Run all rows” or “Run from row” radio option, we can enable this looping set.

Q68. How can we connect the database and execute select statements?

Ans: Below steps can be useful to work with database –

‘Create Recordsetobject

‘Connect to DB using provider and server

objConn.open <connection string for the database>

‘Define SQL Query

sqlQuery=”Select * from student”

‘Execute SQL

objRS.open “Select studentname from student where role=1”, objConnection

‘Display student name

msgbox objRS.fields.item(0)

‘Close connections

objRecordSet.Close

objConn.Close

Set objConn = Nothing

Set objRecordSet = Nothing

Q69. Explain the different approaches to handle synchronization?

Ans: Synchronization issues can be handled by using the below approaches –

• Synchronization can be handled using Wait(timeout) statement with the hardcoded wait time in seconds. At this point, the script will wait for a specified duration and then move on to the next step. Based on the application performance, we need to provide the timeout value.
• WaitProperty – In this approach, we need to provide the property name with values for which execution needs to be a wait and the maximum wait times in mili-seconds. Once the specified property is getting satisfied with expected value, the script execution will proceed with the next step. Example –

Window(“Program Manager”).WinListView(“SysListView32”).WaitProperty “visible”,true,10000

• Also we can use loop to check the appearance of the object to handle the synchronization.

Q70. How to store UFT test cases in ALM?

Ans: Firstly, we need to connect the ALM from UFT through the Connect ALM option. During the connection, we need to provide the ALM Server, Credential, and project details to connect. After the successful full connection, we need to choose the ALM path while saving the test scripts.

Q71. How can we execute UFT test cases from ALM?

Ans: Goto the ALM Test Lab and select the corresponding test cases from the Test Set. By clicking on the Run button to initiate the execution. We can trigger the execution for multiple or entire testset at a time. After initiation, ALM will invoke the UFT in the background and start the execution based on the  selection.

Q72. What setting is available to enable remote execution in UFT?

Ans: Open the Options window from navigation “Tools->Options.” In the General tab, we need to select the Run Sessions section to enable a remote execution setting.

Here we need to set the check box and provide valid credentials of the remote test systems.

### Few more important UFT Interview Questions and Answers:

Q73. Explain the merits of UFT over Selenium?

Ans: The merits of UFT over Selenium are mentioned below –

· Selenium only supports web applications where UFT supports different platforms such as web, SAP, Windows, Mobile, etc.

· Easy to develop/ maintain test scripts in UFT over Selenium.

· Easy to learn UFT in a shorter span of time.

· End-to-end testing is possible in UFT.

· We can test different application interfaces through web services which is not possible in Selenium.

· UFT saves the costs and efforts, mostly in regression testing over Selenium.

· Easy to embed UFT with ALM for test management. The integration between Selenium and ALM is very difficult.

· Test framework setup is easy for UFT.

Q74. How to invoke web browser in UFT?

Ans: Different ways to invoke web applications are –

·         Using SystemUtil.Run method – The structure of the statements is SystemUtil.Run ( Name_of_File, Arguments, File_Path, action)

· Use of VBScripting Wscript.shell class –

Dim oShellSet oShell = CreateObject (“Wscript.shell”)

oShell.run “<Path for browser>”

Set oShell = Nothing

·  Use of object InternetExplorer.Application –

Set obj = CreateObject(“InternetExplorer.Application”)

obj.Visible = True

obj oIE = Nothing

Q75. Explain the approach of the automation recording option?

Ans: It is an approach to generate linear test cases by recording the manual navigation through the UFT. During the recording, the raw test cases are created where data are hardcoded with zero script reusability. It’s useful for one time test execution. It’s not advisable to create the test case for longer run through the recording feature of UFT.

The recording can be initiated by pressing F6 key or clicking on Record button which is available in Record Tab.

Q76. Explain the steps of script debugging?

Ans: Debugging is an approach to identify the script issues through a dummy run. The steps are –

· Create the breakpoint by pressing after the selection of a particular script line from where we need to start the debugging.

· Run the test or start debugging from the first step (Run->Debug from step). Here in the first case, execution will be halted at the breakpoint.

· Now we can debug each code of line by pressing F10(Step Over) or F11(Step into) key. F10 will debug each line in the parent function, but through F11, we can drill down into the sub-functions.

· During the debugging, we can view any variable or state of objects by pressing the “Ctrl+Alt” keys together.

Q77. How to log verification status in UFT reports?

Ans: We can log the verification status using the ReportEvent method. The structure of this method is –

Reporter.ReportEvent status, step_name, details, image_file_name

status – four options are available based on the verification result. micPass, micFail, micWarning, micDone.

step_name – need to provide the actual step name or the expected result.

details – need to provide the actual result.

image_file_name – This is an optional step to provide the screenshot filepath.

Q78. Explain the different types of recording modes in UFT?

Ans: Different recording modes in UFT are mentioned below,

·       Normal mode – The normal mode is the default recording mode available in UFT which uses all the features to identify the test objects. The normal mode is also referred as Contextual, which is applicable only for UFT compatible applications.

·        Low-level recording mode – The low-level recording mode is applicable for applications which are not identified by the UFT. In this mode, scenario is getting recorded based on the co-ordinates of the test objects.

· Analog Recording – Analog recording mode records the movement of mouse and keyboard actions..

Q79. Explain the concepts of a logical name for any object?

Ans: Logical name is defined by the UFT while adding or recording to map any object with the application name. It can be modified based on user object behavior.

Q80. Specify the extension of UFT script?

Ans: The UFT scripts are created with .mts extension.