Qtp material for beginners


Published on

Published in: Business, Technology
  • easy to understand ,thank you
    Are you sure you want to  Yes  No
    Your message goes here
  • thanq......very useful
    Are you sure you want to  Yes  No
    Your message goes here
  • really useful..thankyou so much
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi,

    Technology Specific Guide for QTP is a new book that has got great feedback from all the readers. It will get you started on the path of automation, introducing solutions, roadblocks, patches and ideas that will give you a solid foundation in the field of automation. Everyone from a novice user to an automation expert will have something they would have never heard of or used.


    Best Regards,

    Are you sure you want to  Yes  No
    Your message goes here
  • very usefull thanks a lot
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Qtp material for beginners

  1. 1. For more QTP Scripts, visit www.ramupalanki.com QTP FAQS 1. What are the Features & Benefits of Quick Test pro (QTP)..? Operates stand-alone, or integrated into Mercury Business process Testing and Mercury Quality C enter. Introduces next-generation “Zero-configuration” Keyboard Driven testing technologies in Quick Test Professional 8.0 – allowing for fast test creation, easier. 2. Differences between QTP 6.5 and 8.2 what are extra features in 8.2? Multimedia Add-in is available in QTP 6.5. Multimedia Add-in is not available in QTP 8.2. Parameterization is the extra Features in QTP 8.2. compared to QTP 6.5. 3. How to handle the exceptions using recovery scenario manager in QTP? There are 4 trigger events during which a recovery scenario should be activated. They are A pop up window appears in an opened application during the test run. A property of an object changes its state or value. 4.What is the use if Text output value in QTP? Output values enable to view the values that the application takes during run time. When parameterized, the values change for each iteration. Thus by creating output values, we van capture the values an object in runtime. 5. How to use the object spy in QTP 8.0? To view the Run time objects and Test objects properties and Methods of an object. 6. What is the extension of the object repository files in QTP? Two types of Object repository there are shared repository (extension .tsr) and Action repository(extension .mtr) 7. Explain the concept of object repository & how to QTP recognizes objects? With QTP 8.2, there available QTP plus, setup. It provides Repositories Merge Utility. The Object Repository Merge Utility enables user to merge Object repository files into a single Object repository file. To recognizes a object using properties. 8. What are the properties you would use for identifying a browse & page when using descriptive programming?www.ramupalanki.com
  2. 2. For more QTP Scripts, visit www.ramupalanki.com For Browser we will have to user title, html id property to identify the browser and web page. 9. What are the scripting language you could use when working with QTP? QTP supports vb scripts scripting language. 10. Give me an example where you have used a COM interface In your QTP project? Com interface appears In the scenerio of front end and backend foreign in you are using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface of which COM will be one amoung those interfaces. 11. Few basic questions on commonly used Excel VBA functions. Common functions are: Creatinf a sheets and assigning values to sheets and coloring the cell Auto fit cell setting navigation from link in one cell to other saving. 12. Explain the keyboard create object with an example. Create object: Creates and returns a reference to an Dynamic object. Example: Ser Excel sheet = Create Object(“Excel.Sheet”) 13. Explain in brief about the QTP Automation Object Model. To pre-configure test settings before executing the QTP test. 14. How to handle Dynamic Object in QTP? User GETRO property we will handle the runtime objects. 15. Where can I find the Run-time data table? In the result window shows a run time data table. It includes the table-shaped icon that display the run-time Data Table – a table that shows the values used towww.ramupalanki.com
  3. 3. For more QTP Scripts, visit www.ramupalanki.com run a test containing Data Table parameters or the Data Table output values retrieved from a test while application execution time. 16. How to do Data-Driving in QTP? By parameterizing the test script. 17. What are the differences between call to Action and Copy Action? When you inset a call to action, they are ready only in the calling test. It can be modified in the original test. Where as come to copy action, you can make changes to the copied action, your changes will not effect the original action where it created. 18. Discuss QTP Environment. QuickTestProficinal environment using the graphical interface and Action Screen technologies – A testing process for creating test scripts, relating manual test requirements to automated verification features – Data driving to use several sets of data using. 19. Explain the concept of how QTP identifies object. During tecording QTP looks at the objects and stories it as test objects. For each object QT earns a set of default properties called mandatory properties, and look at the rest of the objects to check whether this properties are enough to uniquely identify. 20. Differentiate the two Object Repository Types of QTP. In QTP there are 2 object repositories, they are 1.Shared Object Repository 2. Per Action Mode, by default it’s per action mode. We want to maintain the Object Repository per each action separately. Select a per action mode. 21. What are the differences are and best practical application of each. Per action: For Each Action, one Object Repository is created. Shared: One Object Repository is used by entire application.www.ramupalanki.com
  4. 4. For more QTP Scripts, visit www.ramupalanki.com 22. Explain what the differences between Shared Repository and Per_Action Repository. In shared repository, one object is used in more than one action and in per action repository, everytime in every, objects are stored differently and are not shared. 23. Have you ever written a complied module? If yes tell me about some of the functions that you wrote. I used the functions for capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages. 24. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them. WR fails to identify the objects in GUI. If there is a non STD window OBK WR cannot recognize it, we use GUI SPY for that to handle such situation. 25. Can you do more than just capture and playback? Yes you can do more than capture/playback. Descriptive programming is the answer to this question. We can write scripts without recording and it would still work fine. 26. How long have you used the product? Depending up on the Licence. 27. How to do the scripting. Is there any inbuilt function in QTP? Yes, there’s an in-built functionality called “step Generator” in Insert>Step>step Generator – F7, which will generate the scripts as you enter the appropriate steps. 28. What are the differences between check point output value. An output value is a value retrieved during the run session and entered into runtime table or data table subsequently it can be used as input value in your test. 29. If we use batch testing. The result shown for last action only. In that how can I get result for every action? Click in the Expend icon in the tree view to view the result of every action. 30. How the exception handling can be done using QTP?www.ramupalanki.com
  5. 5. For more QTP Scripts, visit www.ramupalanki.com Recovery scenerio manager provides a wizard that guides you though the defining recovery scenerio. Recovery scenerio has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run. 31. How do you test siebel application using QTP? In SWE section you need to add Automation Enable = True and at the same time you need to use SWE Cmd = Auto On in the URL. 32. How many types of Actions are there in QTP? QTP supports three types of Actions. 1). Non Reusable actions 2). Re-usable Actions 3). External actions. 33. How do you data drive an external spreadsheet? Import from External Spreadsheet File by selecting Import then From File. Which imports a tabbed text file or a single sheet from an existing Microsoft Excel file into the table? The sheet you Import replace all data in the currently selected. 34. I want to open a Notepad window without recording a test and I do not want to use System Util. Run command as well how do I do this? Another alternative to open a notepad is to use Shell Object. Check out with the following example: Dim a Set a = Wscript.CreateObject(“Wscript.shell”) a.run “notepad.exe”. 35. how many types of recording modes in QTP? Describe each type with an example where we use them? 3 types of recording modes in QTP.1.normal 2.analog mode 3. low level recording mode. 36. How can we do the Frame work in QTP? Depending upon the project and client requirements. 37. Testing>QTP which features of QTP would you like to improve? How would you go about implementing it? We are not implementing any concept in QTP. 38. explain as to how would you design the driver code for a keyboard based test script. Test script prepare in QTP. Key words prepare in a Excel sheet and objects description prepare in notepad.www.ramupalanki.com
  6. 6. For more QTP Scripts, visit www.ramupalanki.com 39. The file extension of Shared object repository. The Share object repository is .tsr extension. 40. How to handle java tree in QTP? First of all we need to handle a java add-in to handle a java tree. In tools we have the “object identification” drop down list. There we have the java option to recognize the objects there select the tree option. Add the properties. 41. How to fetch test data from Database by using QTP? In order to fetch test data from Database we have to create a adodb connection object to connect with data base. The syntax is… >CreateObject(“Adodb.connection”) . 42. What is the procedure to test flash application using QTP? Using Multimedia Add-ins Support. 43. If a error occur during the execution of QTP script. How can we handle it. Using Recovery Scenerio manager. 44. How to merge the object repository files. Using a repository merge tool. It is available with QTplus tool. 45. Can we update the database though QTP. Yes. We can update. 46. How can we pass parameters in a actions? Using Input and output parameters. 47. How can you write a script without using a GUI in QTP? Object repository? Without OR, tester need to write descriptive tests, where you would directly assign property values and write methods. 48. How to load the *.vbs or test generating script in a new machine? By using Test->setting->resources->libraries option. 49. How did you add run-time parameter to a datasheet? Using dt sheet object. 50. What is descriptive programming? Executing the test script with out object repository. 51. How you write scripts in QTP? Using vbscript.www.ramupalanki.com
  7. 7. For more QTP Scripts, visit www.ramupalanki.com 52. How to instruct QTP to display errors and there description in the test results instead of halting execution by throwing error in the mid of execution due to an error (for example Object not found)? By using err object this object value passes to result window. 53. What is the descriptive programming? What is the use of descriptive programming? Test Execution faster. 54. How will you test a stapler? Using user acceptance test. 55. QTP supports Batch test? Yes, Its supported by using test batch runner. 56.Describe the last project scenario and generate test cases for it? Based on the last project functionality we write test cases for it. 57. If there are a lot of bugs to be fixed, which one would, you resolve first. As a tester.. We don’t fix bugs.. we only find bugs As a developer.. Bugs are to be fixed basing on the property and severity of bugs. Sometimes even the severity is low. But if attaches to major functionality, then priority will be more to fix that bug.. 58. What would be strategy to fix bugs in an unknown piece of code? R&D works means basically we can stay it is a verification process. Before you implementing some logic into your function you have to review those to find is there any errors which can be cleared by going through that piece of logic we are going. 59. Define Virtual Object? Virtual Object enable you to record and run tests on objects that are not normally recognized by Quick Test. We can teach Quick Test to recognize any area of your application as an object by defining it as a virtual object. Some times QTP may not recognize some objects. In this kind of Situations Using New Virtual Object. We can convert Cutom Objects into standard Objects. 60. What are Main panes available in QTP Test Browser? Test pane-Contains the Tree View and Expert view tabs Test Details Plan-Contains the Action screenwww.ramupalanki.com
  8. 8. For more QTP Scripts, visit www.ramupalanki.com Debug Viewer pane-Assists you in debugging your test. The Debug Viewer pane contains the Watch Expressions, Variables, and Command tabs. (The Debug Viewer pane is not displayed when you open 103) 61. In what occasion we can specify Global sheet and Action Sheet? We store data in the Global tab when we want it to be available to all actions in our test, for example, to pass parameters from one action to another. 62.Difference between Text and Test Area Checkpoints? Text Checkpoint-Enables you to check that the text is displayed in a screen, window, or Web page, according to specified criteria. It is supported for all environments. Teat Area Checkpoint- Enables you to check that a text string appears within a defined area in a W application, according to specified criteria. It is supported for standard windows, Visual Basic, and A environments, 63. What ate different types of exceptions ? Four types of Exceptions are there 1). Pop-up exception 2). Object State exception 3). Test Run error exceptions 4). Application Crash exceptions. 64. What are the key elements available in Test Results Window? Test Results File bar, Test Results bar, Test result tree, Test result details, Status. 65. With what extension you can save the list of tests in a file to run in Test Batch Runner? .MTB 66. What are Main panes available in QTP Test Browser? Test pane (Tree & Expert), Test Details pane (Active Screen), Date table, Debug viewer pane. 67. How many tabs are available to view your test in a Test pane and what are they? Two these are Tree & Expert. 68. What are the 3 mains stages involved in Testing with QTP? Creating Tests, Running Tests, Analyzing Tests. 69. Write a Function to capture the Pop-up’s? Here I am writing steps to handle pop-up Exceptions. 1. Select the Recovery scenario manager. 2. Press the new scenario 3. Click nextwww.ramupalanki.com
  9. 9. For more QTP Scripts, visit www.ramupalanki.com 4. Select the pop-up exception. 5. Select the pop-window which we want to handle (capture) by clicking the spy button. 6. Press next. 7. Select the specified option like keyboard or mouse operation press next. 8. Select the specified option click default or press enter. 9. Click next and uncheck add another recovery operation. 10. Click next and select proceed next step. 11. Click next and give the scenario name and description. 12. Click next and select add scenario to current test and add scenario to default setting. Click finish Afterward save that scenario. 70. What is meant by hot keys? A hot keys or a combination of keys on a computer keyboard when pressed performs a task. The specific task performed by a particular hot key varies by operating system or application. However, there are commonly _ used hot keys. 71. For a triangle (sum of two sides is greater than or equal to the third side), what is the minimal number of test cases required. Generally, we will calculate the number of test cases that depends on the particular module and its complexity. Minimum number of test=(number of outputs) multiply (1.6) (approx calculation) 72. What are the flaws in water fall model and how to overcome it? Since testing comes at the last stage, there are huge chances of defect multiplication, defects will be migrated to every stage wastage of human resources and time delays are also introduced. 73. How does you test a web link which is changing dynamically? This could be tested through the automated test tools like rational robot and WinRunner. 74.What is system testing and what are the different types of tests you perform in system testing? System testing is a type of Block box testing means testing the application. After the integration testing, usually will do testing. Functionality, Regression, and performance testing comes under system testing. 75. How do we know about the build we are going to test? Where do you see this? In test plat we are going to have all the details about who should test which tests in a team which is given by team leader. According to that the entire group will do their testing. 76. What did u as a team leader? The roles of a lead 1) before the project gets started, will conduct one team meeting and discuss briefly about the upcoming project. 2) will distribute the work among the team member and let them know which part of the application they are going to test3)www.ramupalanki.com
  10. 10. For more QTP Scripts, visit www.ramupalanki.com 77. What test you perform mostly? Regression or retesting in your testing process? Retesting is the repeated execution of the test case which results in a fault, with the aim that fault has been cured, Regression testing is the renewed testing of already tested program or part after modification with the aim that the modified had. 78. Without using GUI map editor? We can recognize the application in WinRunner? Without Using GUI map Editor, We can Recognize the Application objects using a Descriptive programming. QTP (b)1). How to create the dynamic object repository in QTP? Property values of objects of applications may change dynamically each timeyour application opens, or based on certain conditions, to make the test objectproperty values match the property values run time object, we can modify testobject properties manually while design the test or component or using SET TOPROPERTY" Statements during run session.2). What is difference between global sheet and action sheet? A Test is comprised of 1 or more actions. The Global sheet can be accessed byall the Actions in the Test. An action sheet is local to the particular action. The actionsheet is named after the name of the action. The default behavior of the global sheet is that the test iterates for all therows in the Global sheet. If there are 10 rows of data in the global sheet...the testiterates for 10 times. The default behavior of the Action sheet is 1st iteration no matter how manyrows are available. This default behavior can be modified by right clicking on theaction and modifying the actions properties.3). How to pass parameters from one action to another action. You can store the variable you want to pass as Environment Variable in Oneaction and then if you need to access the same variable in another action first youwww.ramupalanki.com
  11. 11. For more QTP Scripts, visit www.ramupalanki.comhave to call that environment variable in second action, store it in some variable anduse it...4). How to perform cross platform testing and cross browser testing usingQTP? Explain giving some example?Cross Platform Testing: There is a provision of getting the Operating system in QTP by using theBuilt in Environment. Eg. Platform = Environment ("OS"). Then based on thePlatform you need to call the actions, which you recorded on that particular platform.Cross Browser Testing:First get the type of browser you are using: Eg. Browser ("CoreValues").GetROProperty("version")This will give you Internet explorer 6 or Netscape 5. Based on this value you call theactions, which are relevant to that browser.5). What conditions we go for Reusable Scripts and how we create and callthat into another script?When we are going to call the action to another actions we are going to set thecalling action as reusable. By setting this then only you are going reuse some otheraction. Otherwise you cannot call that action.Ex: - Login We can record the script for one action and set in the action Properties asReusable. Whenever you need Login script you can call that Reusable Action.6). Is it possible to test a web application (java) with WinRunner?Otherwise is it possible to check with QTP?Which one is best?We find some difficulties, when we use WinRunner to test with the Java based webapplication,But at the same time we don’t find any problem in using the QTP to test the javabased web applicationThese are some of the web application supported by QTP: XML, HTTP, WSDL, SAP,J2EE, .netwww.ramupalanki.com
  12. 12. For more QTP Scripts, visit www.ramupalanki.comSo what i would suggest is to go for QTP to test the Java based we application,Ive heard that a java web application can be tested by WinRunner but is not flexible.Its recommended to use QTP tool for more reliability.7). Can we mask a Code In .vbs file so that it is not viewable to others?VBS file is visible in notepad only not in QTP. We can  add .vbs files in QTP, testmenu->setting->Resource Tab.You also try to open .vbs file in QTP if its open then you only get your questionsanswer.8). Is there any function to double click a particular row in a web table? There will be a function by the name activate. use that function. requiredargument is the row number.9). What is the use of command tab in Debug viewer? Can we execute anyuser-defined queries?Step IntoChoose Debug > Step Into, click the Step Into button, or press F11 to runonly the current line of the active test or component. If the current line ofthe active test or component calls another action or a function, the calledaction/function is displayed in the Quick Test window, and the test orComponent pauses at the first line of the called action/function.Step OutChoose Debug > Step Out or click the Step Out button, or press SHIFT+F11Only after using Step Into to enter a action or a user-defined function. StepOut runs to the end of the called action or user-defined function, thenReturns to the calling action and pauses the run session.Step OverChoose Debug > Step Over or click the Step Over button, or press F10 towww.ramupalanki.com
  13. 13. For more QTP Scripts, visit www.ramupalanki.comRun only the current step in the active test or component. When the currentStep calls another action or a user-defined function, the called action orFunction is executed in its entirety, but the called action script is notDisplayed in the Quick Test window.10.).What is database checkpoint?Database check helps to check database used is correct or not.e.g. : flight reservation : if you right click on the information table of flight and sayadd database check point you would get check point properties ,there select the database icon which looks like excel sheet and click ok. Check point is added, if you wantto add parameterization click on the icon in the value cell and add parameters, datatable will be highlighted, add the places you want to check and run the test... ifsuccessful, means dbcheck point is correct.11). What is the use of function and sub function in QTP? Function and Sub Function are similar. Only the difference is Sub Function willnot return any thing to the function. But using Function it returns result to thefunction.We can use function wherever we need it.We can do parameterization and also reducing the lines of code, etc...12). What is the new Version of QTP which is recently released in theMarket?CURRENTLY QTP 9.0 BETA VERSION IS IN MARKET.NOW MOST OF THE COMPANIESARE WORKING ON QTP 8.2 VERSION.13). How to call a function present in dll file in QTP Script.Execute File "Path of the .vbs file "14). I have n iterations of test run in QTP. I want to see the results of notonly the latest (‘n’th) iteration but also all the previous iterations (1to‘[n-1]’th) While Executing the QTP script, select "New Run Results folder" option fromthe Run dialog box and select the path to save the result file.So that, we can verify previous iterations results also.www.ramupalanki.com
  14. 14. For more QTP Scripts, visit www.ramupalanki.com15). How to call from one action to another action in QTP? Using "Call to Existing Action" we can call one action from another action.Go to insert ->select Call to Existing ActionSelect which action wants to call.16). What is the Difference Between Bit map Check point & Image Checkpoint Please explain in detailFor Bit map Check point we need not have any image, It goes by the screen area.But for image checkpoint we need to have an image.17) How to get the column count and column name from result set indatabase connection program?I am giving examples so that u can under sand easily.1). Example for record countSet dbconn=create object ("adodb.connection")dbconn.open "dsn=xxx"Set objRecordset=create object ("ADODB.Recordset")objRecordset.open "select * from login table", dbconn, 1,3 Msgbox objRecordset.recordcount2). For field namesFor each x in objRecordset.fields Msgbox (x.name)Next18) How to identify a web element class object while recording andrunning in Event mode of settings. I’m able to run either a mouse overoperation or an event but not both as per the requirement...Add html tag and inner text properties to the web element. Remove all otherproperties to that object in object repository.19) What are the new features available in QTP 8.2 compared with earlierversions?Setting parameters to the actions step->action properties->parameters tab here wecan set the input and output parameters.www.ramupalanki.com
  15. 15. For more QTP Scripts, visit www.ramupalanki.com20) What is difference between window (" ") and dialog (" ") in QTP whilecreating script?Window is a separate window that appears on clicking on a particular link on whichwe can perform actions like edit the content etc. This will contain many objects likechkbox, edit box, combo box etc. Developers to validate a field use dialog box. It willcontain an alert message and OK or/and Cancel buttons.21) How do you retrieve the Class name of a Test Object programmaticallyfrom within a script?Using GetROProperty () function22) Testing Mainframe applications.First we have install Terminal Emulator add-in. Then try to identify the objects.The objects will be added to the object Repository, but these objects will beidentified depends the X, Y co-ordinates of the objects.23) Difference Between text and Text area checkpoints in QTPText checkpoint both can check the whole string which u can do by using standardcheckpoint. Difference is that if u wants to validate that a particular string has tocome within a defined area then use text area checkpoint. Use text checkpoint whenthe position of text is critical. Assume u have a text box in one screen that displaysthe name entered in previous screen. u will use text area checkpoint to validate thatname appears within the text box. u will use text checkpoint in this example to seethat surname appears first(assuming some format specified wherein surname shouldbe first).24) What are different execution modes available in QTP & explain them.There is 3-execution mode in QTP they are1. Normal - the default mode where expected & actual results are verified & output isgiven.2. Update - When u want to update the expected result then update mode is used.3. Debug- this requires Microsoft debugger..25) How can we recognize objects in Flex application using QTP?If you are recording in the low level mode. In this mode every object is identified asunder only 2 classes.www.ramupalanki.com
  16. 16. For more QTP Scripts, visit www.ramupalanki.coma) Win Object b) Windows26) How to write QTP test results to an Excel applicationSet Excel sheet=Create Object (Excel. sheet)Excelsheet.Visible=TrueExcelsheet.Activesheet.Cells (1,1). Value=VariableExcelsheet.Saveas"C: C.xls"In addition to the creation of the excel object, you can use the ADO concept as wellas the inbuilt data export function of QTP.1) ADO: In this, you have to create one DSN through ODBC for the Microsoft Excel*.xls driver. Using this defines Adodb.Connection and Record set for the requiredexcel which you want to update. Then simply you can update any column usingRecordset.Updte concept similar in VB2) DataTable.ExportSheet "C: name.xls”, 127) How to write recovery scenario for below questions and what are thesteps we will follow? If I click save button. It is not saving I want to writerecovery scenario how?To write Recovery scenario u must 1st stop recording when u get an error then fromTools menu-> select Recover Scenario ManagerWhen Recover Scenario Manager window is opened u can follow the steps as they rdescriptive & select the appropriate option for the type of error u receive, u have toselect what action is to be performed if this particular error occurs after completingthe entire procedure u need to save the scenario as well as the file.Then thru Test-> Setting-> Recovery option attach the file to the recording & u dohave a choice of whether to activate on every step or etc etc.Thus u can use Recovery scenario to handle exceptions...28) After importing external .xls datasheet into Data table of QTP, How toset NO of iterations run for all row in the Data table? I mean we dot knowHow many rows are existed before importing the .xls sheetFOR i = 1 to datatable.getsheet ("sheet name"). Getrowcount.getrowcount commandwill read up to the last record29) How to test Dynamic web pages using QTPwww.ramupalanki.com
  17. 17. For more QTP Scripts, visit www.ramupalanki.comIf you know the one property of the object. That is sufficient for the QTP to identifythe object. if u know the one object property. at that time we need to use objectidentifier to identikit object we need to add some more properties of the object. Togive unique identification for the object. Or we need to go for the descriptiveprogramming, it bypass the object repository30) How do we connect to Oracle database from QTP?Name: Open ConnectionFunction: Opens a connection to the required databaseInput Parameter: strDriver, strServer, strUserID, strPassword strDriver => Name of Database Driver to be used strServer => Database Server address strUserID => User ID to connect to database strPassword => Password to connect to databaseReturn Value: con => Object: Connection to database NULL if it failsCalls: None [Calls no other user defined function]---------------------------------------------------------------------------------------Function Open Connection(byval strDriver,byval strServer,byval strUserID,byvalstrPassword)Dim strConnectionStringstrConnectionString = "DRIVER=" & strDriver & "; SERVER=" & strServer & ";UID=" & strUserID & "; PWD=" & strPasswordset con = create object ("adodb.connection")con.open strConnectionStringset Open Connection = conEnd Function31) How to configure the environment variables in QTP and how to use the variables,with example?Setting the Environment VariableVARIABLE=Environment. Value ("XXXXXXX")Retrieving the Environment VariableEnvironment. Value ("XXXXXXX")=VARIABLE/CONSTANT32) What is the process for creating an automated test script using QTPassuming you have reviewed the manual test case and understand therequirements?Transferring your testing from Manual to Automation depends upon lot of factors.Depending upon these factors u decide the Framework. Framework is nothing butthe approach by which u implement QTP to your project. There is various type offramework available.... Data, Library, Keyword Driven to name few.www.ramupalanki.com
  18. 18. For more QTP Scripts, visit www.ramupalanki.com33) What is the method used to focus on particular field. I need the script.I will give example.In flight application login page by default the focus is on username field. for this i willcheck the focus was there or not by using GetRoproperty method but if focus is notthere which method i need to use. Getroproperty: retrieves the particular property.Getroproperty: set the property to particular object....to focus to the perticulat text we can use this method:Object. GetTextLocation (TextToFind, Left, Top, Right, Bottom,[MatchWholeWordOnly])Object. GetTextLocation (TextToFind, Left, Top, Right, Bottom,[MatchWholeWordOnly]34) 1) what is the advantage and disadvantage of using Virtual Objectwizard? 2) How efficiently we can use Virtual object Wizard in QTP?Virtual object Wizard we can map Custom Objects (objects which are not recognizedby QTP) to Standard Class.This help to insert checkpoints and for doing DDT for that objects35) Can any body explain me the differences between a reusable and aexternal action with example?Reusable action: An action that can be called multiple times by the test with which itis stored (the local test) as well as by other tests....External action: A reusable action stored in another test...36) How to write QTP test results to an Excel application?Dim fso, f1Set fso = Create Object ("Scripting.FileSystemObject")Set f1 = fso. CreateTextFile ("D:testfile.xls", True)And Then use If conditionsTo store the resultswww.ramupalanki.com
  19. 19. For more QTP Scripts, visit www.ramupalanki.comIf Browser ("abc"). Page("xyz").Exist Then f1.writeline("Step1 Login details is pass") else f1.writeline("Step1 Login details is Fail") End If37) How good is QTP for testing siebel applications? Whether QTPrecognizes siebel objects?QTP supports siebel Application. It is the best Automated tool, which supportsSIEBEL Application.38) The concept of checkpoint declaration in the QTP mainly for the Objects,Pages, Text and Tables?Check point declaration is basically compare two values and give the result..Suppose For Standard checkpoint I have given Text for username should be Lena’s ifany other text appears in that field, suppose Mona appeared in that field thencheckpoint fails to validate and you get result as test case failed for that checkpoint..Basically insertion of checkpoint to get expected output, and should know where testcase goes wrong.In Standard checkpoint one can set height/width/location of X-y co-ordinates ofobject /text etc.39) What is Expert view in QTP? Can you explain with example?n QTP we have two script views: • Expert view • Keyword viewExpert View: Displays the action performed during recording in script view, i.e. VBScriptKeyword view: Displays the action performed during recording in terms of objects.40) What is the best way to do regression testing using QTP?Regression testing is not tool dependent.Firstly there should a regression test strategy, based on this strategy youcan group functional test cases to form regression test suites.www.ramupalanki.com
  20. 20. For more QTP Scripts, visit www.ramupalanki.comThen these test suites are automated based on regression group41) What are the use functions in QTP? Public, privatePublic: In any testing tool not only the QTP if we declare as a Public then we can usethat variable to any function within the scriptPrivate: we can use that variable within the function42) How can we return values from user-defined function? provide codewith small example . a)ArgumentsPublic Indicates that the Function procedure is accessible to all other procedures in all scripts.Default Used only with the Public keyword in a Class block to indicate that the Function procedure is the default method for the class. An error occurs if more than one Default procedure is specified in a class.Private Indicates that the Function procedure is accessible only to other procedures in the script where it is declared or if the function is a member of a class, and that the Function procedure is accessible only to other procedures in that class.Name Name of the Function; follows standard variable naming conventions.Arglist List of variables representing arguments that are passed to the Function procedure when it is called. Commas separate multiple variables.Statements Any group of statements to be executed within the body of the Function procedure.Expression Return value of the Function.Note: So, to return a value, assign the return value to the function name.For Eg:Function Binary Search (. . .) ... Value not found. Return a value of False. If lower > upper Then Binary Search = False Exit Function End If ...End Functionwww.ramupalanki.com
  21. 21. For more QTP Scripts, visit www.ramupalanki.com43) Without recording objects in Object Repository are we able to runscripts? Yes, We can do that by using Descriptive Programming.44) What is Limitation of QTP?4 must know VBScript in order to program at all.4 must be able to program in VBScript in order to implement the real advancetesting tasks and to handle dynamic situations.45) What is descriptive programming?Descriptive program we can work with the objects, which are not there in ObjectRepository. If we use descriptive program we can reduce the size of objectrepository. so QTP performance also increases.46) What are the disadvantages or drawbacks in QTP?1) QTP takes very long to open huge tests. Also CPU utilization becomes 100% inthat case.2) QTP scripts are heavy as it stores all the html files (for active screen) as well.3) Block commenting is not provided till 8.2 version47) What is QTP framework? When we prepare the data for data driventesting?QTP framework is like Test Plan for automation using QTP. It contains informationregarding naming conventions, variables, data for DDT, about the OR path, how thescripts should be commented and what is the purpose of each script etc..48) You are trying to test a web-based application. You invoked QTP fromTD to test the web application. While the TD itself runs on a browser, howdo you ensure that these two browsers do not clash?TestDirector is management tool; it would be used to invoke QTP or WinRunnerscripts one after another. So before we open application (whatever may be theapplication like web based or stand alone application) we should open TD so there isno clash between TD and web based application.49) What are environment variables in qtp?The Environmental Variables in QTP are 1) User-Defined 2) Built-in50) What is keyword driven testing please give process one example.What is the different between data driven and keyword driven testing?www.ramupalanki.com
  22. 22. For more QTP Scripts, visit www.ramupalanki.comKeyword Driven: In the Keyword Driven testing, user can defined screen objects.Suppose, user is adding page title, label name. When scripts are running...theseobjects will be verify with the scripts.Data-driven scripts: In Data-driven testing, user is giving set number of values andreplace these columns name with the declared one in the data driven database.51) How many number of actions possible in QTP?There are 3 types of actions available in QTP1. Reusable2.non-reuseable3. Extern Action52) How to change the Object Repository Mode using CODE? i.e. fromShared to Per Action.Set qApp = CreateObject ("QuickTest.Application") qApp.Test.Settings.Resources.ObjectRepositorytype = "Per Action" Set qApp = Nothing53) How can I implement error handling in QTP and How to recall a functionin QTP?Through exception handling we can implement error handle.In QTP we have fourtypes of exception handles.we can call the function as belowfunction functionname (parameter1, parameter2,....)end function QTP (c) 1. How Does Run time data (parameterization) is handle in QTP?www.ramupalanki.com
  23. 23. For more QTP Scripts, visit www.ramupalanki.com A). You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality or Excel, to manipulate data sets and cteate multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files. 2. What is keyboard view and Expert view in QTP? A). QuickTest’s keyword Driven approach, tet automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the keyword view. Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that QTP aucomatically generates. Any changes made in the Expert View are automatically synchronized with the keyword View. 3. Explain about the test Fusion Report of QTP? A). Once a tester has run a test, a Test Fusion report displays all aspects of the test run a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure, By combining Test Fusion reports with QTP, you can share reports across an entire QA and development team. 4. To which environments does QTP supports? A). QTP supports functional testing of all enterprise environments, including Windows, Web, .Net, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, Mainframe terminal emulators, and Web services. 5. What is QTP? A). QuickTest is a graphical interface record-playback automation tool. It is a able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QTP also enables you to test java applets and applications and multimedia objects on Applications as well as standard windows applications, Visual Basic 6 applications and .NET framework applications… 6. How QTP recognizes Objects in AUT? A). QuickTest stores the definitions for applications objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each object Repository entry will be identified by a logical name (determined automatically by Quick Test), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.www.ramupalanki.com
  24. 24. For more QTP Scripts, visit www.ramupalanki.com 7. What are the types of Object Repositories in QTP? A). QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object. 8. Explain the Check points in QTP? A). A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. 1. A page checkpoint checks the characteristics of Application 2. A text checkpoint checks that a text strings is displayed in the appropriate place on a Application. 3. An object checkpoint(Standard) checks the values of an object on a Application. 4. An image checkpoint checks the values of an image on a Application. 5. A table checkpoint checks information within a table on a Application. 6. An Accessibility checkpoint checks the web page for Section 508 compliance. 7. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your web application. 8. A database checkpoint checks the contents of databases accessed by your. 9. In how many ways we can add check points to an application using QTP? A). We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note: To perform the second one The Active screen must be enabled while recording). 10.How does QTP identifies the object in the application. A). QTP identifies the object in the application by Logical Name and Class. For example: The Edit box is identified by Logical Name: PSOPTIONS_TIME20 Class: Web Edit. 11. If an application names is changes frequently i.e while recording it has name A). “Window1” and then while running its “Window2” in this case how does QTP handles? QTP handles those situations “Regular Expressions” . 12.What is parameterizing Tests?www.ramupalanki.com
  25. 25. For more QTP Scripts, visit www.ramupalanki.com A). When you test application, you may want to check how it performs the same operations with multipie sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data. 13.What is test object model in QTP? A). The object model is a large set of object types or classes that Quick Tests uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application Quick Test stores information about the object that will help it identify and check the object during the run session. A run-time object is the actual object in your web site or application on which methods are performed during the run session. When you perform an operation on your application while recording.  Identifies the Quick Test test object class that represents the object on which you performed the operation and creates the appropriate test object  Reads the current value of the object’s properties in your application and stories the list of properties and values with the test object.  Chooses a unique name for the object, generally using the value of one of its prominent properties.  Records the operation that you performed on the object using the appropriate Quick Test test object method. For Example, suppose you click on a Find button with the following HTML source code: <INPUT TYPE=”submit”NAME =”find”VALUE=”Find”> Quick Test identifies the object that you clicked as a Web Button test object. It creates a Web Button object with the name Find, and records the following properties and values for the Find Web Button: It also records that you performed a Click method on the Web Button. Quick Test displays your step in the keyboard view like this: Quick Test displays your step in the Expert View like this: Browser(“Mercury Interactive”).page(“Mercury Interactive”) . Web Button (“Find”).Click 14.What is Object Spy in QTP? A). Using the Object Spy, you can view the properties of any object in open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the properties tab of the Object Spy dialog box. 15.What is the Difference between Image check-point and Bitmap check- point? A). Image checkpoint enable you to check the properties of web image. You can check an area of a Web page or application as a bitmap. While creating a testwww.ramupalanki.com
  26. 26. For more QTP Scripts, visit www.ramupalanki.com of component, you specify the area you want to check by selecting an object you can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space For example, suppose you have a web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one check on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating systems, screen resolution, and color settings. 16.How many ways we can parameterize data in QTP? A). There are four types of parameters: Test action or component parameters enable you to use values passed From your test or component or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or act on) That runs several times using the data you supply. In each repetition, or iteration, Quick Test uses a different value from the Data Table Environment variables parameters enable you to use variable values from Others sources during the run session. These may be values you supply, or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application hadles small and large ticked orders, you can have Quick Test generate a random number and insert it in a number of ticket edit field. 17.How do you do batch testing in WR & is it possible to do in QTP, if so explain? A). Batch Testing in WR is nothing but running the whose test set by selecting “Run Test set” from. The “Execution Grid”. The same is possible with QTP also. If our test cases are automated then. By selecting “Run Test set” all the test scripts can be executed. In this process the Scripts. Get executed one by one by keeping all the remaining scripts in “Waiting” mode. 18.If i give some thousand tests to execute in 2 days what do you do? A). Adhoc testing is done. It coverts the least basic functionalities to verify that the systemwww.ramupalanki.com
  27. 27. For more QTP Scripts, visit www.ramupalanki.com Is working fine 19.What does it mean when a check point is in red color? What do you do? A). A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue. 20.What do you call the window TestDirector - testlab? A). “Execution Grid”. It is place from whether we Run all Manual/Automated Scripts 21.How do you create new test sets in TD A). Login to TD. Click on “Test Lab” tab. Select the Desired folder under which we need to create the test set. (Test sets can be grouped as per module). Click on “New Test Set or Ctrl+N” Icon to create a Test Set. 22.How do you do batch testing in WR & is it possible to do in QTP, if so explain?A). You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location. Using Test Batch Runner, you can set up a list and save the list as an .mtb file, so that you easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run. 23.How to Import data from a “.xls” file to Data table during Runtime. A). Datatable.Import “…XLS file name…” Datatable.Importsheet(FileName, SheetSource, SheetDest) Datatable>ImportSheet “C:name.xls”,1,”name”. 24.How to export data present in Database to an “.xls” file? A). DataTable.Export “….xls file name…” 25. What do you to script when object are remove from application? 26.Syntact for how to call one script from another? And syntax to call one “Action” in another? A). RunAction ActionName,[IterationMode, IterationRange, Parameters] Here the actions becomes reusable on making this call to any Action. IterationRange String Not always required. Indicates the rows for which action iterations Will be performed. Valid only when the IterationMode is rnfIterations. Enter the row range (i.e “1.7”); or enter rngAll to run iterations on all rows.www.ramupalanki.com
  28. 28. For more QTP Scripts, visit www.ramupalanki.com If the action called by the RunAction statement includes an ExitAction statement, the RunAction. Statement can return the value of the ExitAction’s RetVal argument. 27.How to export QTP results to an “.xls” file? A). By default it creates an “XML” file and displays the results. 28.3 differences between QTP & WinRunner? A). (a) QTP is object bases Scripting (VBS) where WinRunner is TSL (C based) Scriptting. (b) QTP supports “.NET” application Automation not available in WinRunner (c) QTP has “Active Screen” support which captures the application not available in WR. (d) QTP has “Data Table” to store script values, variables which WR does not have. (e) Using a “point and click” capability you can easily interface with objects, their. (f) Definitions and create checkpoints after having record a script – without having. To navigate back to that location in your application like you have to with WinRunner. This greatly speeds up script development. 29.How to add a Runtime parameter to a datasheet? A). DataTable.LocalSheet The following example uses the LocalSheet property to return the local sheet of The run-time Data Table in order to add a parameter (column) to it. My param=DataTable.LocalSheet.AddParameter(“Time”,”5:45”) 30.What scripting language is QTP of? A). Vbs. 31.Analyzing the Checkpoint results? A). Standard Checkpoint: By adding standard checkpoints to your tests or components,you can Compare the expected values of object properties to the object’s current Values during a run session, If the results do not match, the checkpoint Fails. 32.Table and DB Checkpoints: A). By adding table checkpoints to your tests or components, you can check that a specified value. Is display in a cell in a table on your application. By adding database checkpoints to your. Tests or components, you can check the contents of database accessed by your application.www.ramupalanki.com
  29. 29. For more QTP Scripts, visit www.ramupalanki.com The results displayed for table and database checkpoints are similar. When you run test or Component, Quick Test compares the expected results of the check points to the actual results of The run session, If the results do not match, the checkpoint fails. You can check that a specified value is displayed in a cell in a table by adding a table. Chechpoint to your test or component. For Activex tables, you can also check the properties of The table object. To add a table checkpoint, you use the Checkpoint properties dialog box. Table checkpoints are supports for Web and AvtiveX applivation, as well as for variefy of External add-in environments. You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to delete defects. You define a query on your database, and then You create a database checkpoint that checks the results of the query. Database checkpoints are supported for all environments supported by Quick Test, by default, as Well as for a variety of external add-in environments There are two ways to define a database query (a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office. (b) Manually define an SQL statement. The checkpoints timeout option is available only when creating a table checkpoint. It is not Available when creating a database checkpoint 33.Checking Bitmaps: A). You can check an area of a web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space. When you run the test or component, Quick Test compares the object or selected area of the object currently displayed on the web page or application with the bitmap stored when the test or component was recorded. If there are differences, Quick Test captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy. For more information on test results of a checkpoint, see Viewing Checkpoint Results. For example, suppose you have a web site that can display a map of city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms inwww.ramupalanki.com
  30. 30. For more QTP Scripts, visit www.ramupalanki.com the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings. 34.Text/Text Area checkpoint: A). In the Text/Text Area Checkpoint propertied dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run session. Note: In windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane display [complex value] instead of the selected text for the checkpoint. Quick Test automatically displays the Checked Text in red and the text before and after the checked text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed). To designate parts of the captured string as checked Test and other parts as Text Before and Text After, click configure button. The Configure Text Selection dialog box opens. Checking XML : XML (Extensible Markup Language)is a meta-makeup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structure portable between different computer environments/operating systems and programming languages, facilitating the sharing of data. XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading style sheets (CSS) of XSL Formatting objects (XSL-FO) to present the data. You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below: An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response times is needed-for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another. An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, you application’s ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its, attributes, and values have not changed.www.ramupalanki.com
  31. 31. For more QTP Scripts, visit www.ramupalanki.com XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document. Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way. XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML scheme, which describes the structure of the XML elements and data types. You can use scheme validation to check that each item of content in an XML file adheres to the scheme description of the element in which the content is to be placed. 35.Object Repositories types, which & when to use? A). Deciding which Object Repository Mode to Choose To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions: You have only one, or very few, tests that correspond to a given application, interface, or set of objects. You do not expert to frequently modify test object properties. You generally create single-action tests Conversely, the shared object repository mode is generally the preferred mode when: You have several tests that test elements of the same application, interface, or set of objects. You expert the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties. You often work with multi-action tests and regularly use the Insert copy of Action and Insert Call to Action options. 36.Can we Script any test case with out having object repository? Or Using Object Repository is a must? A). No. U can script with out Object repository by knowing the window Handlers, spying and recognizing the Objects logical names and properties available. 37.How to execute a WinRunner Script in QTP? A). (a)TSL Test.RunTest, Testpath, TestSet. [parameters] --> Used in QTP 6.0 used for backward compatibility. Parameters: The test set within Quality Center, in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center Project. When the test is not saved in Quality Center, this parameter is ignored. e.g: TSLTest.RunTest “D:test1”,””www.ramupalanki.com
  32. 32. For more QTP Scripts, visit www.ramupalanki.com (b). TSLTest.RunTestEx TestPath, RunMinimized, CloseApp, [parameters] TSLTest.RunTestEx “C:WinRunnerTestsbasic_flight”, TRUE, FALSE, “MyValue”. CloseApp: Indicates whether to close the WinRunner application when the WinRunner test run ends. Parameters: Up to 15 WinRunner function argument. 38.How to handle Run-time errors? A). On Error Resume Next: Causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the on Error Resumes Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using “Err” object msgbox “Error no:” “ & Err.Number &” . “& Err.Description” “& Err.Source & Err.HelpContext”. 39.How to change the run-time value of property for an object? A). SetToproperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set. 40.How to retrieve the property of an object? A). Using “GetRoproperty”. 41.How to open any application during Scripting? A). SystemUtil, Object used to open and close applications and processes during a run session. (a). A SystemUtil.Run statement is automatically added to your test when you run an application from the start menu or the Run dialog box while recording a test. Eg: SystemUtil.Run “Notepad.exe” SystemUtil.closeDescendentprocesses (closes all the processes opened by QTP) 42.Types of properties that Quick Test learns while recording? A). (a). Mandatory (b). Assistive. In addition to recording the mandatory and assistive properties specified in the object Identification dialog box, Quick Test can also record a bank up ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so. 43.What is the extension of script and object repository files? A). Object Repository: .tsr, Script: .mts, Excel: Default.xlswww.ramupalanki.com
  33. 33. For more QTP Scripts, visit www.ramupalanki.com 44.How to suppress warnings from the “Test results page”? A). From the Test results Viewer “Tools>Filters>Warnings”…must be “Unchecked”. 45.When we try to use test run option “Run from Step”, the browser is not launching automatically why? A). This is default behaviour. 46.Does QTP is “Unicode” compatible? A). QTP 6.5 is not but QTP 8.0 is expected to be Unicide compatabile by end of December 2004. 47.How to “Turn off” QTP results after running a script? A). Goto “Tools>Option>Run Tab” and Deselect “View results when run session ends”. But this suppresses only the result window, but a log will be created and can viewed manulaly which cannot be restricted from getting created. 48.How to verify the cursor focus of a certain field? A). Use “Focus” property of “GetRoProperty” method. 49.Any limitation to XML checkpoints? A). Mercury has determined that 1.4MB is the maximum size of XML file that QTP 6.5 can handle. 50.How to make arguments optional in a function? A). This is not possible as default VBS doesn’t support this. Instead you can pass a blank scring and have a default value if arguments are not required. 51.How to covert a string to an interger? A). CInt()--- > a conversion function available. 52.Inserting a call to Action is not Importing all columns in Datatable of globalsheet. Why? A). Inserting a call to action will only Import the columns of the Action called.www.ramupalanki.com