https://www.qatechies.com

Latest QTP Interview Questions and Answers (Latest UFT Interview Questions)- Part 2

Latest Tosca,QTP,UFT,CodedUI Interview Questions

Latest QTP Interview Questions and Answers (Latest UFT Interview Questions)- Part 2


Welcome to this post!-“Latest QTP Interview Questions and Answers (Latest UFT Interview Questions)- Part 2”

If you are looking for latest HP UFT \ QTP  interview Questions, then you are at right place. This post consists of some exhaustive questions which had been part of interviews. Usually these are assumed to be known before moving to deeper technical questions on UFT or QTP, Go ahead and enjoy reading…

Below post discusses about some important questions and answers on HPE UFT (Micro Focus) QTP/UFT interview.


1.   How actions and functions are different?

 

Ans. Every Action has their own local OR and datatable, unlike functions which do have either of these. Functions are meant to evaluate a condition and return the appropriate value post execution. The code that follows inside functions is written in vbscript/javascript etc.

Functions are saved with extensions – “.vbs” or “qfl” whereas actions with “.mts”.

 


2.   Can we run multiple test scripts in sequence?

 

Ans.  Yes, create a batch file for all the intended regression test cases and later execute them using the batch runner tool.

 


3.   Explain process of smart Identification?

 

Ans.  Usually objects get identified using UFT default object recognition mechanism. Suppose if the recorded attributes or properties are insufficient in identifying the object then as next step in identification, a “smart identification” option (if enabled) is called which uses the definition of such objects and tries to identify the object using “Smart identification” algorithm.

 


4.   How can you associate function library at run time?

 

Ans. You can specify statement as shown below :

  1. Use LoadFunctionLibrary method:

LoadFunctionLibrary “Completepath”

  1. Use the ExecuteFile method:

ExecuteFile “Completepath”.

 


5.   What are the advantages of Hybrid framework?

 

Ans. Hybrid framework – a combination of frameworks (like keyword and data driven) that make makes your solution more robust, flexible, scalable and adaptable to the changes in the SUT.

 


6.   What is the difference between a Function and Subroutine in VB Script?

 

Ans. Functions basic principle is to support the test scripts in its action steps. The function is used to evaluate certain conditions and return the results accordingly. For this it might require some input parameters may be string, integers, test objects, arrays etc and later return the value which can be used in further action steps.

While in Subroutines are also similar to function, where you might see vbscript code that might perform actions but for sure it doesn’t return a value. The main purpose of subroutine is the set the environment for running the test cases. Subroutines can take arguments similar to functions.

 


7.   Is VB Script Case Insensitive or sensitive?

 

Ans. It is not case sensitive with respect to command and variable names. Everything else, like strings (text) is.

 


8.    What are the factors or causes on which script execution time is dependent?

                                           Or

What will be your approach in identifying the execution time factors / causes?

 

 

Ans. Following are the causes to be considered:

  1. The response time from the application, the database etc.
  2. Some dynamic objects are dependent on the state of action, hence we use synchronization keywords like wait, sync etc. these also impact.
  3. Descriptive programming (DP) may take longer in identifying the test object and much more time when step fails, and hence impacting the execution time.
  4. Capturing screenshots if enabled.
  5. Usually, we keep smart identification “disabled”, which also speeds up the running time.

 


9.   Is Static and dynamic arrays are handled by VB script. Is it true?

 

Ans. Yes.

A static array is declared as Dim A(5). This means it’s an array of 6 items.

**If the tester needs to modify it to contain more 20 items he can do so by using ‘redim’.

Redim A(25)

There is also a “Preserve” keyword which does considers the elements of the array defined earlier unlike Redim keyword which only restate the array or resize, to be specific, the array without keeping the old elements. So actually we use like:

Redim Preserve A(25)

 


10.    Describe object identification in QTP \ UFT in brief?

 

Ans. QTP has a predetermined set of properties that it learns/stores for every class of object it identifies. There are 3 aspects to this:

Mandatory properties:

List of properties in relation to object to identify it based on the class in which objects belongs to. These properties are predefined per class. Usually these predefined properties are enough to identify uniquely the object.

 

Assistive properties:

For some object it might happen, that only mandatory are not sufficient in that case to identify the test object assistive properties if defined will be taken into consideration. This will obviously increase the time of recognition of test object as with all mandatory properties a pair is made with one single assistive property i.e. first try will be like (mandatory + assistive1), if it still fails will move onto second try (mandatory+assisstive1+assisstive2), hence it will compile one by one each of the assistive properties with mandatory properties.

 

Ordinal Identifier:

Now, suppose if the assistive properties also fails in the unique identification of the test object then qtp or uft will include the ordinal identifier such as the object’s location on the page or in the source code, to create a unique description.

 


11.    Describe Smart identification?

 

Ans. Smart identification is a mechanism or algorithm that kicks into if none of the recorded description of the test object is able to uniquely identify the object. This feature is dependent whether it is being enabled in the settings or not. If enabled this will kick in if the recorded description does not enable to identify a specific object. It uses the following additional properties to identify the test object

  1. Base Filter Properties –

 

The most fundamental properties of a particular test object class. These whose values cannot be changed without changing the essence of the original test object.

 

Example:

Base Filter Properties:

Property Value
 

html tag

 

INPUT

 

  1. Optional Filter Properties

 

These are other properties that can help identify objects of a particular class like WebCheckBox, etc. These properties are unlikely to change on a regular basis. The good part here is these can be ignored if they are no longer applicable.

 

Example:

 

Optional Filter Properties:

Property Value
alt Password
name

 

Password

 

****Both of the above properties are completely configurable and can be used for any object type class.

 


12.    What is an object repository?

 

Ans. Object Repository (OR) is a repository or store of test objects. The test objects that QTP or UFT learned during the recording process are stored with all the descriptive properties. These properties help uniquely identify the test object. You can change the values of the properties as per requirement in the right pane where properties are listed.

 


13.    What is the function of Object Spy?

 

Ans. The native plus identification properties and operations of any object in SUT can’t be viewed directly. So UFT gives us opportunity to view and plan our property value pair to be included for a test object using “Object Spy” tool. The tool shows 2 views one property and one operations tab where we can toggle between native and identification properties plus native and test object operations respectively.

 


14.    Describe the various types of repositories?

 

Ans. These are the two kinds of available repositories:

  1. Local and,
  2. Shared repository

Every action in UFT has a ‘local’ repository, datatable and has all the objects that are used within it. This is by default.

Shared repository on the other hand are common across all the actions which have been set.

 


15.    The test script has one action which uses both the local and shared OR. In the test which one will be considered?

 

Ans. According to the UFT algorithm it doesn’t matter what hierarchy you have set for various SOR and LOR. If the object has same name as per hierarchy being recorded for that test object, the action will consider the object in its local OR.

 


16.    How many SOR can be associated with single action of the test? Plus, in that case, if two of SOR contain the same object, which one will be considered?

 

Ans. Firstly, it possible to have more than one SOR. Sceanrio could be different parts of application which have so many test objects that it has been divided into 2 or more SOR.

Coming to the second part of questions, if SOR1 and SOR2 have one object named login each. And suppose there is a statement calling same object then the “order” in which the SORs were associated in the OR setting window, will be considered.

 


17.    Does UFT give you option to configure LOR and SOR at the same time? Or Does UFT gives you opportunity to work with LOR and SOR for same action?

 

Ans. Both the question meant same thing. It’s true we can switch between one or the other types of ORs at any time. To do such configuration of OR’s, go to the top menu option and look for Test->Settings->Resources and choose the options as required.

 


18.    Are all SOR’s read-only? Or Can you disable the read-only feature on any SOR?

 

Ans. This is related to very internal working of UFT. So if we discuss on abstract view, yes SORs are always opened as read-only. There is no option of disabling such feature on it, instead we can edit only in Object Repository Manager i.e. “ORM->File->Enable Editing”.

 


19.    Can you guess the locationID of any test object for which you know already the index id?

 

Ans. There are two different concepts merged in this question. Firstly, Location is the value is based on the order in which the object appears within the window, frame, or dialog box, in relation to other objects with “identical properties” and not similar. So, the first occurrence of the test object is always 0. These values are assigned in fashion of columns from top to bottom and left to right.

Now let’s discuss Index, UFT can assign a value to the test object’s Index property to uniquely identify the test object. This value is based on the order in which the object appears within the source code. Hence, the first occurrence for it will be 0. So in short, if you have 3 controls say link1, webedit2, link3 then index id will be 0,1,2 respectively for each of them irrespective of the location on the screen.

Now lets come to the question, so if know the parent of the test object or locate the exact container in which it lies then you can guess the locationID. So point here is that if you know which parents holds this object it’s possible to retrieve the locaitonID.

 


20.    What are the extensions of action file and object repositories in QTP?

 

Ans. For any test, we can see there are some files like SOR, LOR, function files etc.

LOR file have:    <file_name>.mtr

SOR file have:     <file_name>.tsr

Code file have:    script.mts

Function files have :  .qfl , vbs


 

 

If you would like to keep track of further articles on UFT (QTP). I recommend you to subscribe by Email and have new UFT articles sent directly to your inbox.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

advanced-floating-content-close-btn
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5034726663464946 (adsbygoogle = window.adsbygoogle || []).push({});
advanced-floating-content-close-btn 
*************************** Do you want to learn TOSCA? Do you want to excel in Career? Try my New Courses: 1. Tricentis Tosca and Working with Excel   2. Tricentis Tosca and UI Automation Great News!!   Price has been slashed down for limited period of time.So Hurry!!! Click The Shown Links and Enjoy Learning. ***************************
 
error: Content is protected !!