Search here for all the info you want in this Blog

QTP important interview QUestion 7


41. Object Repositories types, which & when to use?
          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 expect 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 expect 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.

42. Can we Script any test case with out having Object repository? or Using Object Repository is a must?
          Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.
  
43. How to execute a WinRunner Script in QTP?
          Ans : (a) TSLTest.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", ""
  
      (b)        
          TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
          TSLTest.RunTestEx "C:\WinRunner\Tests\basic_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

44. 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 Resume 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

45. How to change the run-time value of a property for an object?
          Ans : 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

46. How to retrieve the property of an object?
          Ans :  using "GetRoProperty".

 47. How to open any application during Scripting?
          Ans : 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
 E.g :  SystemUtil.Run "Notepad.exe"
          SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)
48. Types of properties that Quick Test learns while recording?
          Ans : (a) Mandatory (b) Assistive . 
                   In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup 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.

49. What is the extension of script and object repository files?
          Ans :  Object Repository : .tsr   ,  Script :   .mts, Excel : Default.xls

50. How to supress warnings from the "Test results page"?
          Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

No comments:

Post a Comment