Explore topic-wise InterviewSolutions in .

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.

I successfully developed and executed a script, which I then saved to QC. When I tried to run the script from within QC, it didn't work. What could be the reasons?

Answer»

The FOLLOWING points should be considered while checking for the reason for the failure of the script within QC:

  • To begin, install the QuickTest Add-In for Quality Center.
  • 'Allow other Mercury products to execute tests and components' should be selected in the QTP Tools -> Options -> run a tab.
  • Ensure that QTP is being executed as an administrator.
  • All test resources MUST be in the proper order.
Conclusion

In this article, we have covered the most frequently asked interview questions on UFT. If you're writing code in an interview, don't FORGET to provide comments. Demonstrate good programming techniques. Before going to a QTP interview, MAKE sure you know what version of QTP you're using, what add-ins you're using, what versions of other software you're using, and so on. It will take a couple of HOURS to re-familiarize yourself with QTP if you haven't used it in a while but have prior familiarity.

Useful Resources:

  • Top Testing Tools
  • UiPath Interview Questions
  • Tosca Interview Questions
2.

What do you understand about Object Spy in the context of UFT?

Answer»

Object Spy is a FEATURE in UFT that allows you to SEE the properties and METHODS of both test and run-time objects. It also contains the syntax for a particular method. Object Spy displays the entire hierarchy of the object you've chosen. Object Spy is a TOOL that allows you to add objects to the Object Repository in QTP. The TOOLBAR, as seen below, can be used to access Object Spy.

3.

What are the various methods for launching an application in UFT?

Answer»

Following are the different methods of launching an application:

  • SystemUtil.Run:

Following is the SYNTAX for USING SystemUtil.Run

SystemUtil.Run ( FileName, Parameters, Path, Operation )

Example: 

SystemUtil.Run("chrome.exe",http://www.google.com)SystemUtil.Run("test.txt", "","C:\","1")
  • InvokeApplication:

We can also use the InvokeApplication COMMAND for launching an application.

InvokeApplication "C:\Program Files\Google Chrome\CHROME.EXE http://www.google.com"
  • Using VB SCRIPT to create a shell object:

Example: We create a “WScript.shell” object.

Dim testshellSet testshell= CreateObject ("Wscript.shell")testshell.run "%windir%\paint"
4.

What do you understand about the Expert view and Keyword view in the context of UFT?

Answer»

EXPERT view: Each line in the Expert View represents a VB Script Test Step. Consider the code below. 

Dialog("Login").WinEdit("Site Name:").Set "InterviewBit"

Following the Object Type, the name of an object is shown in parenthesis. Login is the object name, and Dialog is the object type. A "dot" separates objects in an Object HIERARCHY. The Object Hierarchy of Dialog and WinEdit is the same in this case. To PUT things in context, Object Hierarchy is an Object Oriented Concept that refers to a collection of items that are linked in a parent-child connection. In our situation, the Parent Object is Dialog Box, and the Child Object is WinEdit. At the end of the statement, the operation done on the object is always printed, followed by any values associated with the operation. Using the Set METHOD, the term "InterviewBit" is placed in the Site Name Edit Box.

The GUI object on which the operation is done, along with its WHOLE hierarchy, is the syntax for a statement in expert view, followed by the Operation on the Object and the value associated with that Operation. This is shown as below:

ParentObject(Name).ChildObject1(Name)...ChildObjectN(Name).Operation

Keyword view: The Keyword View is a table-like view in which each step is represented by a single row in the table and each column by different sections of the steps.

  • The item on which you want to perform the step is listed in the Item Column. The hierarchy of the GUI item on which the operation is done is displayed in this column using icons.
  • The operation to be performed on the object is listed in the Operation Column.
  • The Value Column includes the argument values for the selected operation, while the Documentation Column describes each step for simple understanding.
  • These four columns are the defaults, however, assignment and comment columns can also be used in Keyword View.
5.

What do you understand about virtual objects in the context of UFT? What are the limitations of the virtual objects in UFT?

Answer»

Standard WINDOW objects may be present in an application under test, but UFT may not recognise them. In certain cases, objects of the type button, link, or other can be declared as virtual objects (VO) so that user actions can be mimicked on the virtual objects during execution.

For example: Let's pretend we're automating a Microsoft Word scenario. We open the MS Word application and click on any of the ribbon icons. For example, on the Ribbon, the user selects the Insert tab, then selects the "PICTURE" button. Here, a button is recognised as a WinObject, emphasising the RELEVANCE of virtual objects.

Following are the limitations of virtual objects in UFT: 

  • For analog or low-level recording, QTP does not allow virtual objects.
  • Virtual Objects cannot have checkpoints added to them.
  • Object Repository has no control over Virtual Objects.
  • Although we MAP an object to a specific class (button or List), Virtual objects do not provide all of the original object's methods.
  • Virtual Objects are not supported by Object Spy.
  • If the screen resolution changes as the coordinates change, the test will fail.
  • Virtual objects should be recorded correctly if the application window is the same size as the screen.
6.

Differentiate between UFT and Selenium.

Answer»
  • UFT: Functional, regression, and service testing are the most common uses for the tool. UFT allows testers to automate user behaviours on a web or client-based computer application, as well as test and uncover defects that may arise as a result of such actions. This holds true for the IDENTICAL operations performed on different people, DATA sets, Windows operating systems, and browsers. Automation with QTP/UFT, if properly planned and executed, can save a lot of time and money.
  • Selenium: Selenium is an open-source umbrella project providing a collection of web browser automation technologies and libraries. Without having to learn a test scripting language, Selenium provides a playback tool for building functional tests (Selenium IDE). It also includes a test domain-specific language (Selenese) for writing tests in JavaScript (Node.js), C#, Groovy, Java, Perl, PHP, Python, Ruby, and Scala. Most recent web browsers can then be USED to run the tests. Selenium is available for Windows, Linux, and Mac OS X. It's free software distributed under the Apache License 2.0.

The following table lists the differences between UFT and Selenium:

Unified Functional Testing (UFT)Selenium 
It is a Micro Focus commercial tool, thus it requires a licence and is costly.It's an open-source testing tool, therefore there's no need for a licence and it's completely free.
It's used for client-server application testing. It can test both web and desktop applications.Only web applications can be automated with Selenium.
Only the QTP IDE can be used to create QTP tests.Selenium can be used with a variety of IDEs, including Visual Studio, Eclipse, and Netbeans.
Only VB scripts are supported by HP UFT.Selenium supports a wide range of programming LANGUAGES, including Java,.NET, Ruby, Perl, PHP, and many others.
A built-in object repository is included with HP UFT. In HP ALM, creating and maintaining object repositories is a breeze.Although Selenium lacks a built-in object repository, objects can be maintained using the UI element user extension.
HP UFT is compatible with test management software such as HP Quality Center.Selenium is not compatible with any such test management software.
UFT Testing supports all forms of dialogue boxes.It partially supports dialogue boxes.
It supports a variety of environments, including SAP, Oracle, and.NET, but users must acquire an add-on licence for each of them.It allows you to add plug-ins to provide FUNCTIONALITIES that Selenium doesn't give by default.
Because of the licencing fees, automation testing is costly.Selenium web automation testing is less expensive.
HP QTP provides excellent technical support.Because it is an open-source project, it receives no formal support.
Only VBScript is supported by HP QTP. Hence Test Automation using an Object-Oriented Approach gets difficult.Selenium supports Object-Oriented Programming Languages such as Java.
HP QTP is more user-friendly, and scripts may be written faster.It's a simple tool with limited capabilities. The development and maintenance of a script take more time.
Backward compatibility has a lot of power. The most recent version of HP ALM supports code that was written five years ago.In Selenium, the API evolves with each new Selenium release. As a result, test scripts must be modified.
7.

What are the different types of object repositories available in UFT?

Answer»

Following are the different types of object repositories available in UFT:

  • Local Object Repository: The default object repository is the Local Object Repository. It is ACTION-SPECIFIC and can only be used for one action at a time. When the application is not time-sensitive, a local object repository is preferred. The Local Object Repository can't be utilised again. In the local object repository, you can do a variety of things, including -
    • On the application under test, highlight an object saved in a repository.
    • Check to see if a specific object in your AUT is saved in the Object Repository.
    • Objects can be cut, copied, pasted, modified, and deleted.
    • If you mistakenly changed the value of a property, you can edit its description using the UPDATE function in the application.
  • Shared Object Repository: When an application is dynamic and object descriptions CHANGE frequently, a global or shared object repository is preferred. In automation projects, shared object repositories are more typically utilised than local object repositories. HOWEVER, when compared to a local object store, it has higher maintenance and administration costs.
8.

What do you understand about object repositories in the context of UFT? Explain how object identification works in UFT.

Answer»

UFT recognises an Object Repository as a collection of Test Objects and information for working on it. By default, when a user records a test, the objects and their properties are recorded. UFT will not be able to playback scripts until it UNDERSTANDS objects and their properties.

  • Object Identification in UFT can be described in the FOLLOWING points:
  • For object identification, UFT employs "human-like" technology.
  • UFT tries to learn the properties of a GUI object on which an operation is performed during Record.
  • Micro Focus UFT compares the recorded object attributes to the real object properties available on-screen during run-time and uniquely identifies an object regardless of its location on the screen.
  • TEST Object is the name of the stored object and its characteristics.
  • The actual object available on the APPLICATION under test during Run-Time is referred to as the Run-Time Object. This is the "Test Object MODEL" from Quick Tests.
  • The Object Repository STORES information about the Test Objects.
  • Add-ins assist in informing Quick Test ahead of time about the nature of the object to be recorded, reducing the time spent learning its properties.
9.

What are the different types of recording modes available in UFT? Is it possible to change between Recording modes while creating a Test?

Answer»

Following are the different types of recording modes available in UFT: 

  • Context-Sensitive Recording MODE: Context-Sensitive Mode is another name for regular recording mode. It's the default recording mode, and it makes the most of Quick Test Professional's test object MODEL. It recognises things in the app no matter where they are on the screen. It keeps track of the objects in your programme and the operations you make on them.
  • Analog Recording Mode: Quick Test Professional records and tracks every movement of the mouse as you drag it around a screen or window in analogue recording mode. Analog recordings made by UFT are saved as Tracks in your test directory. It's handy for capturing operations that can't be captured at the object LEVEL. For instance, a signature is created by dragging the mouse. You may record in analogue mode in the following ways:
    • In relation to the screen - Use the screen option when your analogue operation involves many screens, such as dragging and dropping an object from one window to another.
    • In relation to the window - Use relative to a window when your analogue operation is limited to a single window.
  • Low-Level Mode: This mode allows you to record any object in your application, regardless of whether QTP recognises the object or operation. All run-time objects are recorded as Window or WinObject test objects in this mode, which records at the object level. It's utilised when you need to know the exact coordinates of an object for your tests. Hashmaps are a nice example, where clicking different portions of a picture lead to different URLs. This mode of recording is used when recording tests are done in an environment that QTP does not recognise. The x,y coordinates of any clicks are recorded in low-level mode. 
    Analog and low-level recording use up more disk space than standard recording. Screen positions during recording and playback MUST be SIMILAR in both modes, or the script will fail. As a result, only use analog or low-level recording when the regular recording mode fails to adequately capture your operation. When recording objects or surroundings that QTP does not support, QTP will occasionally convert to low-level mode.

Yes, we can switch to Analog/Low-level mode in the middle of a recording, accomplish the task at hand, and then return to conventional recording. The Analog mode switch is only available when recording, not while editing.