Monday, December 15, 2008

QTP Interview Questions



1.Main difference between QTP and Winrunner?

  • QTP supports .NET,SAP
  • QTP uses VBscript while Winrunner uses TSL


2.If requirments changed then how we can teach the QTP this is the new requirment
  I
f there is measure change in GUI or functionality of  application then create new test.
                               OR
If some of objects & it's properties are changed do changes in OR such changing logical name or add/delete 
objects.

3.What's the difference in between function and sub and give 
some code as well?

A Function procedure is a series of VBScript statements enclosed by the Function and End Function statements. A Function procedure is similar to a Sub procedure, but can 
also return a value. A Function procedure can take arguments a Function procedure has no arguments, its Function statement must include an empty set of parentheses.

Function Celsius(fDegrees)
   Celsius = (fDegrees - 32) * 5 / 9
End Function

A Sub procedure is a series of VBScript statements (enclosed by Sub and End Sub statements) that perform actions but don't return a value. A Sub procedure can take 
arguments (constants, variables, or expressions that are passed by a calling procedure). If a Sub procedure has no arguments, its Sub statement must include an empty set of 
parentheses ().

Sub ConvertTemp()
   temp = InputBox("Please enter the temperature in degrees 
F.", 1)
   MsgBox "The temperature is " & Celsius(temp) & " degrees 
C."
End Sub

4.I have a pblm in qtp,im testing an webappl in which different types of error pop up messages are displayed which qtp is not differentiating or it is not recognising.
how do i make it recognise different popup errorm messages 
while writing script?

Use the Recovery manger to diffrentiating the pop up..Here you have two check box options like
1. Window title and Regular expression
2. Window text contains

5.If an application name is changing frequently i.e while recording it has name “Window1” and then while running 
its “Windows2” in this case how does QTP handle?

QTP handle this type situation using "Regular expressions",like :"Windows.*"("*" indicates 0 to many no.s/characters ... in this case 1 2 3 4 5 ........)

Yes..We can handle such situation using the regular expressions.Select "window1" in the script.Goto tools and open the object repository.Select Window1 in the tree that 
gets displayed.In the configure value click the constant value option button and change the value from "window1" to "window.*" and click the Regular expression 


6.What is the BPT(bussiness process testing ).and what is the 
main difference between BPT and QTPcheckbox.

  • "Mercury Business Process Testing" is a complete system for  functional testcase design for both automated and manual testing. It enables non-technical subject-matter experts to become an integral part of the quality optimizationprocess, automates the creation of test-plan documentation, and streamlines test maintenance for application change."QTP(Quick Test Prefessional)" is a functional testing tool, by using this we can do the regression testing also
  • business process testing means first we recording some componenets and we did some enhancement and we bound those componets using QC and we will start running the scripts.In business process testing each script treat as a components nothing else.In QTP one scope ot testing is BPT 
7.What are the designobjects in QTP?
As per my knowlege, there are only two types of objects:
1. Test Objects
2. Run-time object


8.
What are the 5 types of objects in qtp?


QTP supports 6 types of objects:
Standard Windows Object – Methods and Properties within this object can be used for testing standard windows objects

ActiveX Objects – Methods and Properties within this object can be used for testing ActiveX objects

Visual Basic Objects – Methods and Properties within this object can be used for testing Visual Basic objects


Web Objects – Methods and Properties within this object can be used for testing Web Objects

Utility Objects – Methods and Properties within this object can be used for testing Utility Objects

Supplemental Objects - Methods and Properties within this object can be used for testing Supplemental objects

 

9.What is difference between function and procedure?

 

Action is a part of Function.Function is a Like a Functional Test case.Procedure is a process to perform the Different Actions.
Function can return a value procedure cannot return a value.
Difference b/w Action Function in QTP?
Action : 1.when u want to use object repository facility we go for action,(means when the appliction contains objects witch recognied by QTP ) go for Actions is nothing  but mouse moments it will generate the script automatically.  2. it will returns more than one out put values.   Functions : 1 when the objects witch r not recognised by QTP we go for functions(means discriptive program in that those objects is not stored under objectrepository) 2. it will returns only one out put value.
 
10.In QTP what is the difference between Step-in, Step-out, Step-over ?
Step-in:Line by line execution  Step-over:which is used to speed up debugging..we can go with step-over if we know perticular funtion is bug free ex: if script contains a loop means when we use step-over  option the loop wont be executed only the result of the  loop ill be displayed...  step-out:which is similar to step-in ex: if script contains a loop means when we use step-out option the loop will be executed....
11.What are the Latest Feature are added In QTP 9.2?
Block commenting , Check syntax
12.QTP recognizing objects as "string_1","string_2","string_3","string_4" like that but when using FOR LOOP for these.QTP not proceeding further can i declare these _1,_2,_3,_4 as a single variable
As stated in the question that values are changing as "string_1","string_2","string_3","string_4" this is mainly because the index value is changing..  Note : go to repository for string_1 and check the index value , likewise check the index value for string_2 and string_3..check if all three have an oderly increments like  for string_1 the index value in object repository will be 1 and string_2 should be 2.. and so on.  All to need to do is consider one recorded object either srting_1 or string_2 .. or any one amoung the four recorded object .. After loop completed one iteration and moves to  second iteration, jst set the index value of selected object to 1, 2.. and so on ..Use SetTo property method to set the index value ..
13.What is the difference between keyword driven frameworkd and Modularisation framework?
Modular FrameWork: QuickTest Records the operation and executes operation basedon actions, which is consider as  modules.  Keyword FrameWork: Based on a Keyword if we are calling a  function, which is keyword Framework.
Modularity Frame works is Application and System dependent.  Its old and initial method of frame work. It has two components: 1.Generic script 2.Call lib  In generic script has script from theier we calling  call.lib in which we record the application and store it..   Keyword Driven Frame Work. It is advanced one. It is  Application and system independent.  It has four components:  1.Script folder  a)Mani lib  b)call lib  c)proc lib(process library)  d)std lib 2.Repository folder 3.Excel sheet 4.Notepad file
 
 
14.Difference between GetRoProperry and GetToProperty.and where we've to use exactly those properties? 
 
GetToProperty: returns the specific property value from the  test object properties descriptions.  GetRoProperty: returns the current property value of the  object durting the test run.
 
GetRoProperty:--(Get Run Time object Property) At the time of execution, properties of an object may  change. These properties at execution time is called RunTime object property. EG:- x co-ordinate of insert order button should be 125.    (OR)   In some web applications like in Naukri some of  objects are blinking that type of object is run time   (OR)   ScreenSavers.  GetToProperty:-- The property of an object at the time of  learning(recording)
15.Where exactly we can't do the automation testing. give some examples
We can not do the automation testing for the following  scenarios: 1. For the newly build application 2. For Smoke Testing of the application 3. For the application to be tested only once 4. For the application which has to be tested in rush time 5. For UAT
 16.Explain the concept of object repository & how QTP recognises objects?
Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). we can view or modify the test object description of any test object
in the repository or to add new objects to the repository.Quicktest learns the default property values and determines in which test object  class it fits.If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description.
If no assistive properties are available, then it adds a special Ordianl identifier such as objects location onthe page or in the source code 

 

Object Repository is a storage place where we can store the objects information and it is also act as an interface between the test script and AUT (Application under Test) in order to identify objects during execution 

There are 2 types of Object Repository

1) Per-action: For each and every action separate Object repository is created and is managed by QTP

2) Shared Repositary: Object repositary can be associated to mulitple test, it can be managed manually, advantage of Shared repository is easy to maintain.

 

 

 

 

 

 

 

 

 

 











No comments:

Post a Comment