Qtp interview questions


Published on

Published in: Education, Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Qtp interview questions

  1. 1. for more QTP scripts, visit www.ramupalanki.comQuestion Explain about V-model? © ALL Interview .comAnswer V-model is a model in wch we do verification and validation parallely...Answer V-Model is one of the software development model, it is suitable for short-termprojects.here both verification & validation activities are done parallely as soon as get therequirement from the customer.In v-model, left side of v is Verification done and rightside of v is validation done.In verifiction side, get the requirement from customer(CRS)& then that CRS is extracted asSoftware Requirement Specification(SRS)& then SRS is converted to Arctect design(HLD)ie,ghlevel design document its done by Senior Arctect & then HLD is divided as LLD(low leveldesign document)is done by Senior software enggr.and then coding will be done based onLLD.here all documents are verified and reviewed. and other side of v-model is Validationactivity, here from bottom to up like wise unit tesing is done based on LLD document,thenIntegration testing is done based on HLD document, then System testing is done based on SRSdocument after finish the System testing , end project move across to Customer side, herecustomer done Acceptance testing based on CRS.it consists of two testing one isalpha testing is done controlled environment at developers site with customer involvement,and another one is beta testing is done by end user at real world condition.Who will repare SRS?What is the basis for SRS preparation? © ALL Interview .comAnswer The System Analyst/Project Manager/Technical Manager prepare SRSThey are going to check the application on below areas1. Feasibility of application2. Tentative Planning3. Technology Selection4. Requirrement AnalysisQuestion what is regression testing? © ALL Interview .comAnswer After the Bug fixed ,testing the application whether the fixed bug is affectingremaining functionality of the application or not.Question How will you prepare Test plan. What are the techniquesinvolved in preparing the Test plan. © ALL Interview .comAnswer Test Plan will prepared bt TEST lead& as a Test engineer weinvolves in1)desigining the test cases2)Executing the test cases3)bug trackingd)report defectAnswer Test plan means planning for the release. Ts includes Project backgroundTest Objectives: Brief overview and description of the documentTest Scope: setting the boundariesFeatures being tested (Functionalities)Hardware requirementsSoftware requirementsEntrance Criteria (When to start testing): Test environment established, Builder receivedfrom developer, Test case prepared and reviewed.Exit criteria (when to stop testing): All bug status cycle are closed, allfunctionalities are tested, and all gh and medium bugs are resolved. Project milestones:dead linesWhat is the difference between Call to Action and Copy Action.?Call to Action : The changes made in Call to Action , will be reflected in the orginalaction( from where the script is called).But where as in Copy Action , the changes madein the script ,will not effect the original script(Action)How does Parameterization and Data-Driving relate to each other in QTP?www.ramupalanki.com
  2. 2. for more QTP scripts, visit www.ramupalanki.comTo datadrive we have to parameterize.i.e. we have to make the constant value as parameter,so that in each iteraration (cycle) it takes a value that is supplied in run-timedatatable. Through parameterization only we can drive a transaction(action) with differentsets of data. You know running the script with the same set of data several timesis not suggestable, & its also of no use.Discuss QTP Environment.QuickTest Pro environment using the graphical interface and ActiveScreen technologies - Atesting process for creating test scripts, relating manual test requirements toautomated verification features - Data driving to use several sets of data using one testscript.What is a Run-Time Data Table? Where can I find and view this tableIn QTP, there is data table used , which is used at runtime.-In QTP, select the option View->Data tabke.-This is basically an excel file, which is stored in the folder of the test created, itsname is Default.xls by default.How to handle dynamic objects in QTP?by using reguler expressions we can handle dynamic objects in qtp ORQTP has a unique feature called Smart Object Identification/recognition. QTP generallyidentifies an object by matching its test object and run time object properties. QTP mayfail to recognise the dynamic objects whose properties change during run time. Hence it hasan option of enabling Smart Identification, wherein it can identify the objects even iftheir properties changes during run time.Check this out-If QuickTest is unable to find any object that matches the recorded object description, orif it finds more than one object that fits the description, then QuickTest ignoresthe recorded description, and uses the Smart Identification mechanism to try to identifythe object.While the Smart Identification mechanism is more complex, it is more flexible,and thus, if configured logically, a Smart Identification definition can probably helpQuickTest identify an object, if it is present, even when the recorded description fails.The Smart Identification mechanism uses two types of properties:Base filter properties—The most fundamental properties of a particular test object class;those whose values cannot be changed without changing the essence of the originalobject. For example, if a Web links tag was changed from to any other value, you could nolonger call it the same object. Optional filter properties—Other properties thatcan help identify objects of a particular class as they are unlikely to change on a regularbasis, but which can be ignored if they are no longer applicable.Explain in brief about the QTP Automation Object Model.Essentially all configuration and run functionality provided via the QuickTest interface isin some way represented in the QuickTest automation object model via objects, methods, andproperties. Although a one-on-one comparison cannot always be made, most dialog boxes inQuickTest have a corresponding automation object, most options in dialog boxes can be setand/or retrieved using the corresponding object property, and most menu commandsand other operations have corresponding automation methods. You can use the objects,methods, and properties exposed by the QuickTest automation object model, along withstandard programming elements such as loops and conditionalExplain the keyword createobject with an example.Creates and returns a reference to an Automation objectsyntax: CreateObject(servername.typename [, location])Argumentsservername:Required. The name of the application providing the object.typename : Required. The type or class of the object to create.location : Optional. The name of the network server where the object is to be created.What are the different scripting languages you could use when working with QTP ?Visual Basic (VB),XML,JavaScript,Java,HTMLWhat does VBS file contain...??? what is VBS file.. ???www.ramupalanki.com
  3. 3. for more QTP scripts, visit www.ramupalanki.comvbs file contains the user defined functions which are reusable that can be used in ourtest or compnent according to our requirementWhat are the properties you would use for identifying a browser & page when usingdescriptive programming ?"name" would be another property apart from "title" that we can use.ORWe can also use the property "micClass".ex: Browser("micClass:=browser").page("micClass:=page")..What is the file extension of the code file & object repository file in QTP?File extension of-- Per test object rep :- filename.mtr-- Shared Oject rep :- filename.tsrCode file extension id script.mtswhat is the use of Text output value in Qtp?Output values enable to view the values that the application talkes during run time.Whenparamaterised, the values change for each iteration.Thus by creating outputvalues, we can capture the values that the application takes for each run and output themto the data table.What are the Features & Benefits of Quick Test Pro (QTP)..?(a). Key word driven testing(b). Suitable for both client server and web based application(c). Vb script as the scriot language(d). Better error handling mechanism(e). Excellent data driven testing featuresBy default Action1 runs first in QTP. Is it possible to start the run with Action2?es it is possible. Place the cursor at the start of your Action2 and right click, selectRun from Step.What is parameterization? What is syncronization pt.?QuickTest enables you to expand the scope of a basic test or component byreplacing fixedvalues with parameters. This process, known as parameterization,it greatly increases thepower and flexibility of your test or component.synchronization point is that which handles anticipated timing problems by ensuring that QTwaits for some times until the application is ready for the next stepwhat is descriptiveprograming? how to do object identification thrugh Descriptive and ispossible smart identification or notDescriptive Programming: Whenever QTP records any action on any object of anapplication, it adds some description on how to recognize that object to a repository ofobjects called object repository. QTP cannot take action on an object until unless itsobject description is in the Object Repository. But descriptive programming provides a wayto perform action on objects which are not in Object repositoryWhat are accessibility check point and xml check point?Identifies areas of a Web site to check for Section 508 compliancy.Check if the images on a Web page include ALT properties, Activex checks, Applet check,Frame work, multimedia links, serverside images required by the W3C Web ContentAccessibility GuidelinesXML check point id used to check the statistical information of webpage or web page frame. XML Check point has two modes 1.XML check point for Page 2.XML check point for Frame. XML check point for Page,It verifies broken links XML check point for Frame,It verifies no of links No of Bitmaps,...etcwhen qtp recognizes a web link like (hyper link)wich properties it is going to take toidentify the objects unquely? what is Ini file in QTP?QTP recognises the web link with following object properties Name :www.ramupalanki.com
  4. 4. for more QTP scripts, visit www.ramupalanki.com Class:FOR example if you click on web link like www.yahoo.com,QTP recognised the link with folling attributes: Name:Yahoo! class:page inthis way it identies the web link.How to load a object repository(using VBScript) ... very urgent....Dim appSet app =CreateObject("QuickTest.application")app.test.settings.resources.ObjectRepositoryPath= "C:Documents and Settingsaa.tsr"Can any body tell me how can I choose the share object repository and per action objectrepository mode. Please give me with steps.In QTP, default mode is per-action. We have a multiple actions within the same script,each and every action contains separate object repository. In per-action bothscript and object repository both are tied with each other. If you choose as shared object repository, all actions contains only one objectrepository. We can use this object repository to any actions, and memory is also save. Herescript and object repository both are independent with each other. Go to test menu --> click resources tab --> you can view shared or per-action objectrepository.(In QTP 8.2 version)What are FAST and NORMAL modes in qtp ? Why r these modes intended for ?When ur running from QC it is in Fast Mode and Normal Mode is when execute from QTP.Main Difference is in Fast Mode QTP doesnt show Execution marker where as in Normal Modeit will show the Execution Marker.What is the difference between "call to action" and "call an existing action"call to action : the changes made in call to action, will be reflected in originalaction(from where the script is called).But where as in call to copy Action , the changesmade in the script will not effect the original script(Action).call an existing actionmeans calling a reusable action that is stored in same test or in some othertest wich is like a function call.Re: how do u retrieve data from a database ? i.e. i want to retrieve 2nd record only from adatabase ? write code for this. by using ADODB connecton, RSOBJ and using a FOR loop we canretrieve all the records( ex: if we give query as select * from emp). but i want only 2ndrecord. so how to acheive this.I think you need to set your for loop so that it reads only2 records or as many records from the record set that youwant. i.e for i = 1 to 2read the next recordnext this way you have the 2nd recordhow do check the links in a webpage ?You can check it using“if obj_ChkDesc(“html tag”).value = empty then”How do u write regular expression for a window name which is changing for each build ? i.e.in first build the window name is : "computer graphics are very ...." . in second build thewindow name is : "computer graphics can be created" . - Appreciate proper repliesI think the right answer is "computer graphics.*".Here “.” means any single character and “*” means 0 or moreoccurrences of preceding character. So .* means 0 or moreoccurrences of any character.How do u write a regular expression for date (dd/mm/yyyy) field ?[0-3][0-9]/[0-1][0-9]/[1-2][0-9][0-9][0-9][0-9] Pls let me know completely about descriptive programming, where it is used, pls explainwith a real time example of its occurence and the program code written in qtp.www.ramupalanki.com
  5. 5. for more QTP scripts, visit www.ramupalanki.comWhenever QTP records any action on any object of an application, it adds some descriptionon how to recognize that object to a repository of objects called object repository. QTPcannot take action on an object until unless its object description is in the ObjectRepository. But descriptive programming provides a way to perform action onobjects which are not in Object repositoryThere are two ways in which descriptive programming can be used1. By creating properties collection object for the description.2. By giving the description in form of the string arguments.Hi guys, can anyone explain me whats the method for reporting the QTP test results toteamlead or non-QA member (developer/PM)? Thanks in Advance!!!!!Prepare a Text file with High Level results then report by mailing the same.How do u retrieve data from a text file into different variables. i.e. in a text file named"source" , the data is like : india,1000,japan,200,china,50,singapore,45050 this is givenin the first line of the text file. in the second line of the text file the dta is:sun,moon,planet,river,earth,water if u use "readline" method by using FSO concept u canretrieve the entire line in to a variable. but i want to import each field (ex: "india" inone variable, "1000" in another variable etc..). Apprecitae proper replies.set fso=createobject("scripting.filesystemobject")set f=opentextfile(path,1)set a=new regexpa.pattren="[a-z]+|(d)+"a.ignorecase=truea.global=truedo while f.atendofstream <>truer=f.readlineset b=a.execute(r)for each val in bmsgbox valnextloopf.closedz will get u much information later u can modify as per ur requriment.I am using excel sheet to export data to QTP but it selects just one row of data from excelsheel how to import all rows of excel sheet to QTP during runtimeHere i am sharing a small snippet script, to import the data from Excel sheet to QTP duringruntime and using the values.I have an Excel sheet which contains OrderNumber column and its values. After that i amdisplaying the order numbers in excel during runtime.datatable.Import("E:Programming SamplesQTP SamplesOrderNumbers.xls")datatable.GetSheet(1)rowCount=datatable.GetRowCountFor i=1 to rowCount datatable.SetCurrentRow(i) val=datatable.Value("OrderNumber","Global") msgbox(val)NextWhile recording a login window QTP is identifying only parent window,then how can uidentify the child objects.you can use "ChildObjects" method to to identify child objectsfor Eg:It will click on all child objectsSet oDesc = Description.Create()oDesc("html tag").Value = "INPUT" set hai=Browser("WinCraft2 - Enterprise_2").Page("WinCraft2 - Enterprise").Frame("content").ChildObjects(oDesc)www.ramupalanki.com
  6. 6. for more QTP scripts, visit www.ramupalanki.comcount1=hai.count()msgbox hai1For i=1 to count1hai(2).clickNextI want to check in the data table(Globalsheet) column exist or not through script .Ifcolumn not exist only proceeded to next step Pls tell me how to proceeded?Function isParameterExists(sheetName, paramName)isParameterExists = FALSEParamTotal = DataTable.GetSheet("Global").GetParameterCountFor i = 1 To ParamTotalvalue = DataTable.GetSheet("Global").GetParameter(i).NameMsgbox valueIf strComp(paramName,value)=0 ThenisParameterExists=TRUEExit FunctionEnd ifNextEnd FunctionExample:If isParameterExists("Global","hh") thenmsgbox "Patameter exists"Elsemsgbox "Patameter does not exist"<Your statements>End ifwhat is QTP batch testing tool?in qtp tool only one option is avaliable to do batch testing .(batch run, see in the amdtool in qtp)batch testing is nothing but run the test suite(a set oftest scripts). In this just give the path of each script and run the batch.suppose u hav a dialog or window which contains 10 buttons with same name & value. now howto check each button? i.e. how qtp indetifies these objects separately?QTP identifies object based on mandatory properties ,assitive properties which are presentin the object repositery and it also uses its smart identification if it is enable .if atall it unable to find the object with this properties it will go for ordinal identifier ORThis Will Show the order used to identify the object when two or more objects getduplicated.tools -> object identificationselect the environmenta) standard windowsb) active-Xc) visual basicd) multi mediaselect the class if we select the environment as standard window and class as winbuttonthen it will displayMandatory properties Assistive properties ordinaliden- tifier-------------------- ------------------- ------------a)Native class a)window-ID a)locationb)Test b)Indexwhat is the process to follow between writing the test cases & then atomating it?Manual written test cases will help at the first execution of the build and it will beconsumed upto the get the stable build. It includes all the validations and thewww.ramupalanki.com
  7. 7. for more QTP scripts, visit www.ramupalanki.combehaviour of the application . In this scripts the Navigation steps should be clear.Automation of scripts will happens after getting stable build to test regression effects.The same scripts which we executed manually will be used for automation. Based on theexpected values we will be placing the check points. Automation is not a creation of testcases but same written test cases will be automated by record and play back option.www.ramupalanki.com