Sei sulla pagina 1di 8

QTP Interview Questions Part-IV 1) What are the differences between Actions and Functions and which are

better? Actions: o Its a QTP feature and Local feature (not a global feature) o We can use check points in Actions o As it is QTP feature it may corrupt o Actions are slo e!ecution Functions: o Its a "# script feature and global concept o We cant use checkpoints in functions$ instead of checkpoints e can use %alidation points (Loops and &onditional statements) o It doesnt corrupt o 'unctions are faster in e!ecution than Actions 2) ow create !ethods in QTP? #y associating procedures to test ob(ects) ") ow to enhance tests with windows API functions? With the help of W*+ (It is a Windo s administration tool)$ e can use Windo s API functions for enhancing Tests)

#) What are the !a$or differences between functions and actions in QTP? What advanta%es there in functions than actions? ,ead -.st /uestion and ans er) &) What is Auto!ation 'b$ect (ode)? Its a process of Automating the Quick test operations) To do this e can use (a%a script$ "&00 and )12T Apart from "#script) *) What is Windows +cri,t ost? W*+ is a indo s administration tool$ it pro%ides hosting en%ironment for running "#script$ 3script scripts) -) What is e.ce,tion hand)in%? +andling e!pected and une!pected errors during e!ecution /) What is the difference between constants and variab)es in V0 +cri,t? We use constants for replacing literal %alues and constants ne%er change) We use %ariables for storing %alues that returned by the program$ functions$ etc) "ariable %alues may %ary through out the script)

1) ow test en%ineer identifies when ,ro%ra!!atic descri,tions are usefu)? o If application is not ready (using screenshots and documents e can prepare descripti%e programming) o If e ant to make our scripts global o If lengthy tests are there and that e ant to e!ecute fast 12) ow to retrieve data fro! a,,)ication ob$ects? 4sing loop statements and 5et,6Property method 11) ow to bui)d scri,ts that access data fro! e.terna) resources? We can fetch test data directly from e!ternal files and databases by creating automation ob(ects 2!7A868#$ 'ilesystemob(ect 12) What is ob$ect s,3 used for? It is a feature of QTP$ used for getting the ob(ects information (all properties and %alues) )It is a%ailable in QTP tool main indo $ in Local repository and in ob(ect ,epository 9anager 1") What is the ,ur,ose of in,ut ,ara!eters? 'or Passing %alues 1#) What is an Action? ow !an3 t3,es of Actions are there in QTP?

*et of statements to perform a task or tasks is called an Action) Three types of actions are there) .) non reusable actions -) reusable actions :) 2!ternal actions In QTP ;)- default action is7 1on reusable In QTP .<)< default action is7 ,eusable 2!ample7 Let there are t o tests 7 test7. and test7In test7. let there are t o actions a)login (reusable)and b) insert order(nonreusable) in test7- let there are t o actions a)open order(reusable) and b) fa! order(non reusable) If e call login action from test7. in test 7- then login action is called 2!ternal action) In test 7- login is reusable but calling point of %ie its e!ternal action 1&) What is a virtua) ob$ect? ow to confi%ure virtua) ob$ects? Whene%er QTP is not recogni=ing an area or user defined ob(ect as an ob(ect that e can make as a %irtual ob(ect) 'or making %irtual ob(ects QTP is pro%iding a feature called "irtual ob(ect manager) Through this e can configure %irtual ob(ects) 1*) What are d3na!ic ob$ects?

The ob(ect$ hich properties change dynamically (fre/uently)) We can use ,egular 2!pressions to handle dynamic ob(ects) 1-) What is the ,ur,ose of descri,tion ob$ect? The purpose of description ob(ect is to store multiple properties %alues of a test ob(ect) 1/) What is the advanta%e of associatin% a ,rocedure to a test ob$ect? #y associating a procedure to a test ob(ect e can use this as a method on that test ob(ect) 11) ow to create a 4ibrar3 Fi)e? 6pen an 2ditor (2!7 1otepad)$ 5enerate some script statements and sa%e ith )%bs e!tension) In a library file e can put more than one function also 22) What are the disadvanta%es of usin% actions? o Action is a QTP tool feature that occupies QTPs more memory space) o It may be corrupted) o It is not a global feature) Test engineer may not ha%e the control on action) 21) What is the difference between Test 'b$ects and 5un Ti!e 'b$ects ?

Test ob(ects are basic and generic ob(ects that QTP recogni=e) ,un time ob(ect means the actual ob(ect to hich a test ob(ect maps) 22) 6an i chan%e ,ro,erties of a test ob$ect? >es) >ou can use *etT6Property to change the test ob(ect properties) It is recommended that you s itch off the *mart Identification for the ob(ect on hich you use *etT6Property function) &an i change properties of a run time ob(ect? 1o (but >es also)) >ou can use 5et,6Property(@outerTe!t@) to get the outerTe!t of a ob(ect but there is no function like *et,6Property to change this property) #ut you can use Web2lement())ob(ect)outerTe!tA@*omething@ to change the property) 2") When and Wh3 to use 7escri,tive ,ro%ra!!in%? #elo are some of the situations hen 8escripti%e Programming can be considered useful7 The ob(ects in the application are dynamic in nature and need special handling to identify the ob(ect) The best e!ample ould be of clicking a link hich changes according to the user of the application$ 2!) BLogout CC4ser1ameDDE) When ob(ect repository is getting huge due to the no) of ob(ects being added) If the si=e of 6b(ect repository

increases too much then it decreases the performance of QTP hile recogni=ing a ob(ect) When you dont ant to use ob(ect repository at all) Well the first /uestion ould be hy not 6b(ect repository? &onsider the follo ing scenario hich ould help understand hy not 6b(ect repository *cenario .7 *uppose e ha%e a eb application that has not been de%eloped yet) 1o QTP for recording the script and adding the ob(ects to repository needs the application to be up$ that ould mean aiting for the application to be deployed before e can start of ith making QTP scripts) #ut if e kno the descriptions of the ob(ects that ill be created then e can still start off ith the script riting for testing *cenario -7 *uppose an application has : na%igation buttons on each and e%ery page) Let the buttons be B&ancelE$ B#ackE and B1e!tE) 1o recording action on these buttons ould add : ob(ects per page in the repository) 'or a .< page flo this ould mean :< ob(ects hich could ha%e been represented (ust by using : ob(ects) *o instead of adding these :< ob(ects to the repository e can (ust rite : descriptions for the ob(ect and use it on any page) 9odification to a test case is needed but the 6b(ect repository for the same is ,ead only or in shared mode i)e) changes may affect other scripts as ell) When you ant to take action on similar type of ob(ect i)e) suppose e ha%e -< te!tbo!es on the page and

there names are in the form t!tF.$ t!tF-$ t!tF: and so on) 1o adding all -< the 6b(ect repository ould not be a good programming approach) 2#) ow to use 7escri,tive ,ro%ra!!in%? There are t o ays in hich descripti%e programming can be used7 a) *tatic Programming7 #y gi%ing the description in form of the string arguments) b) dynamic Programming7 #y creating properties collection ob(ect for the description

Potrebbero piacerti anche