qtpmaterialforbeginners-110103234815-phpapp01

Embed Size (px)

Citation preview

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    1/32

    QTP FAQS1. 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-configurationKeyboard Driven testing technologies in Quick Test Professional 8.0 allowing forfast 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 inQTP 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 inQTP?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 runtime. When parameterized, the values change for each iteration. Thus by creatingoutput 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?

    For Browser we will have to user title, html id property to identify the browser

    and web page.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    2/32

    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-shapedicon that display the run-time Data Table a table that shows the values used to

    run a test containing Data Table parameters or the Data Table output values

    retrieved from a test while application execution time.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    3/32

    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 bemodified 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 its 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.

    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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    4/32

    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, theres 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 intoruntime 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?

    Recovery scenerio manager provides a wizard that guides you though the

    defining recovery scenerio. Recovery scenerio has three steps 1. TriggeredEvents 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    5/32

    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. Whichimports 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.

    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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    6/32

    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.

    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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    7/32

    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 dont 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 screen

    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 inour 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    8/32

    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 Stateexception 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-ups?

    Here I am writing steps to handle pop-up Exceptions.1. Select the Recovery scenario manager.2. Press the new scenario3. Click next4. 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 pressedperforms a task. The specific task performed by a particular hot key varies byoperating system or application. However, there are commonly _ used hot keys.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    9/32

    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 theparticular module and its complexity. Minimum number of test=(number ofoutputs) 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 defectmultiplication, defects will be migrated to every stage wastage of humanresources 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 andWinRunner.

    74.What is system testing and what are the different types of tests youperform in system testing?System testing is a type of Block box testing means testing the application. Afterthe integration testing, usually will do testing. Functionality, Regression, andperformance 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 testsin a team which is given by team leader. According to that the entire group willdo their testing.

    76. What did u as a team leader?

    The roles of a lead 1) before the project gets started, will conduct one teammeeting and discuss briefly about the upcoming project. 2) will distribute thework among the team member and let them know which part of the application

    they are going to test3)77. What test you perform mostly? Regression or retesting in yourtesting process?

    Retesting is the repeated execution of the test case which results in a fault, withthe aim that fault has been cured, Regression testing is the renewed testing ofalready tested program or part after modification with the aim that the modifiedhad.

    78. Without using GUI map editor? We can recognize the application inWinRunner?Without Using GUI map Editor, We can Recognize the Application objects using aDescriptive programming.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    10/32

    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 object

    property 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 test

    iterates 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 action's 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 youhave 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    11/32

    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 web

    application,

    But at the same time we dont find any problem in using the QTP to test the javabased web application

    These are some of the web application supported by QTP: XML, HTTP, WSDL, SAP,J2EE, .net

    So what i would suggest is to go for QTP to test the Java based we application,

    I've heard that a java web application can be tested by WinRunner but is not flexible.It's 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 it's 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 Into

    Choose Debug > Step Into, click the Step Into button, or press F11 to run

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    12/32

    only the current line of the active test or component. If the current line of

    the active test or component calls another action or a function, the called

    action/function is displayed in the Quick Test window, and the test or

    Component pauses at the first line of the called action/function.

    Step Out

    Choose Debug > Step Out or click the Step Out button, or press SHIFT+F11

    Only after using Step Into to enter a action or a user-defined function. Step

    Out runs to the end of the called action or user-defined function, then

    Returns to the calling action and pauses the run session.

    Step Over

    Choose Debug > Step Over or click the Step Over button, or press F10 to

    Run only the current step in the active test or component. When the current

    Step calls another action or a user-defined function, the called action or

    Function is executed in its entirety, but the called action script is not

    Displayed 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...

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    13/32

    12). What is the new Version of QTP which is recently released in the

    Market?

    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 not

    only the latest (nth) 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.

    15). 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 Action

    Select which action wants to call.

    16). What is the Difference Between Bit map Check point & Image Checkpoint Please explain in detail

    For 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 in

    database connection program?

    I am giving examples so that u can under sand easily.

    1). Example for record count

    Set 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.recordcount

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    14/32

    2). For field names

    For each x in objRecordset.fieldsMsgbox (x.name)

    Next

    18) How to identify a 'web element' class object while recording andrunning in 'Event' mode of settings. Im 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 earlier

    versions?

    Setting parameters to the actions step->action properties->parameters tab here wecan set the input and output parameters.

    20) What is difference between window (" ") and dialog (" ") in QTP while

    creating 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 programmatically

    from within a script?

    Using GetROProperty () function

    22) 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 QTP

    Text 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 to

    come 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).

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    15/32

    24) What are different execution modes available in QTP & explain them.

    There is 3-execution mode in QTP they are

    1. 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.

    a) Win Object b) Windows

    26) How to write QTP test results to an Excel application

    Set Excel sheet=Create Object (Excel. sheet)

    Excelsheet.Visible=True

    Excelsheet.Activesheet.Cells (1,1). Value=Variable

    Excelsheet.Saveas"C: C.xls"

    In addition to the creation of the excel object, you can use the ADO concept as well

    as 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 VB

    2) DataTable.ExportSheet "C: name.xls, 1

    27) 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 write

    recovery scenario how?

    To write Recovery scenario u must 1st stop recording when u get an error then fromTools menu-> select Recover Scenario Manager

    When 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    16/32

    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 to

    set NO of iterations run for all row in the Data table? I mean we dot knowHow many rows are existed before importing the .xls sheet

    FOR i = 1 to datatable.getsheet ("sheet name"). Getrowcount.getrowcount commandwill read up to the last record

    29) How to test Dynamic web pages using QTP

    If 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 descriptive

    programming, it bypass the object repository30) How do we connect to Oracle database from QTP?

    Name: Open Connection'Function: Opens a connection to the required database'Input 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 database'Return Value: con => Object: Connection to database' NULL if it fails'Calls: 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 = con

    End Function

    31) How to configure the environment variables in QTP and how to use the variables,with example?

    Setting the Environment Variable

    VARIABLE=Environment. Value ("XXXXXXX")

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    17/32

    Retrieving the Environment Variable

    Environment. Value ("XXXXXXX")=VARIABLE/CONSTANT

    32) What is the process for creating an automated test script using QTPassuming you have reviewed the manual test case and understand the

    requirements?

    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.

    33) 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 not

    there 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 objects

    35) Can any body explain me the differences between a reusable and a

    external 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...

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    18/32

    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 condition's

    To store the results

    If Browser ("abc"). Page("xyz").Exist Thenf1.writeline("Step1 Login details is pass")elsef1.writeline("Step1 Login details is Fail")End If

    37) How good is QTP for testing siebel applications? Whether QTP

    recognizes 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 Lenas if

    any other text appears in that field, suppose Mona appeared in that field then

    checkpoint 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 view

    Expert View: Displays the action performed during recording in script view, i.e. VBScript

    Keyword view: Displays the action performed during recording in terms of objects.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    19/32

    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.

    Then these test suites are automated based on regression group

    41) What are the use functions in QTP? Public, private

    Public: In any testing tool not only the QTP if we declare as a Public then we can usethat variable to any function within the script

    Private: we can use that variable within the function

    42) 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 inall scripts.

    DefaultUsed only with the Public keyword in a Class block to indicate that theFunction procedure is the default method for the class. An error occurs ifmore than one Default procedure is specified in a class.

    PrivateIndicates that the Function procedure is accessible only to other proceduresin 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 thatclass.

    NameName of the Function; follows standard variable naming conventions.

    ArglistList of variables representing arguments that are passed to the Functionprocedure when it is called. Commas separate multiple variables.

    StatementsAny group of statements to be executed within the body of the Functionprocedure.

    ExpressionReturn 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

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    20/32

    Binary Search = FalseExit FunctionEnd If

    . . .End Function

    43) 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?

    testing 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 version

    47) 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, how

    do 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-in

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    21/32

    50) What is keyword driven testing please give process one example.What is the different between data driven and keyword driven testing?

    Keyword 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 QTP

    1. Reusable

    2.non-reuseable

    3. Extern Action

    52) 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 = Nothing

    53) How can I implement error handling in QTP and How to recall a function

    in QTP?Through exception handling we can implement error handle.In QTP we have fourtypes of exception handles.

    we can call the function as below

    function functionname (parameter1, parameter2,....)

    end function

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    22/32

    QTP (c)

    1. How Does Run time data (parameterization) is handle in QTP?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 multipletest 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). QuickTests keyword Driven approach, tet automation experts have full

    access to the underlying test and object properties, via an integrated scriptingand debugging environment that is round-trip synchronized with the keywordview.Advanced testers can view and edit their tests in the Expert View, whichreveals the underlying industry-standard VBScript that QTP aucomaticallygenerates. Any changes made in the Expert View are automaticallysynchronized 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 testspecifying exactly where application failures occurred, the test data used,application screen shots for every step that highlight any discrepancies, anddetailed explanations of each checkpoint pass and failure, By combining TestFusion reports with QTP, you can share reports across an entire QA anddevelopment 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 Testenables you to test standard web objects and ActiveX controls. In addition tothese environments, QTP also enables you to test java applets andapplications and multimedia objects on Applications as well as standardwindows applications, Visual Basic 6 applications and .NET frameworkapplications

    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 bya logical name (determined automatically by Quick Test), and will contain aset of properties (type, name, etc) that uniquely identify each object.Each line in the Quick Test script will contain a reference to the object thatyou interacted with, a call to the appropriate method (set, click, check) andany parameters for that method (such as the value for a call to the setmethod). The references to objects in the script will all be identified by thelogical name, rather than any physical, descriptive properties.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    23/32

    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 choosewhich type of object repository you want to use as the default type for newtests, 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 inyour test so that you can create and run tests without creating, choosing, ormodifying object repository files. However, if you do modify values in anaction object repository, your changes do not have any effect on otheractions. Therefore, if the same test object exists in more than one action andyou modify an objects property values in one action, you may need to makethe 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 testfor standard web objects using QTP.

    1. A page checkpoint checks the characteristics of Application2. 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 oneThe 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 byLogical Name: PSOPTIONS_TIME20Class: Web Edit.

    11.If an application names is changes frequently i.e while recording ithas nameA).Window1 and then while running its Window2 in this case howdoes QTP handles?

    QTP handles those situations Regular Expressions .

    12.What is parameterizing Tests?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 tocheck how your application responds to ten separate sets of data. You couldrecord ten separate tests, each with its own set of data. Alternatively, you can

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    24/32

    create a parameterized test that runs ten times: each time the test runs, ituses 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 ofrelevant methods that Quick Test can record for it.A test object is an object that Quick Test creates in the test or component torepresent the actual object in your application Quick Test stores informationabout the object that will help it identify and check the object during the runsession.A run-time object is the actual object in your web site or application on whichmethods 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 testobject

    Reads the current value of the objects properties in your application andstories the list of properties and values with the test object.

    Chooses a unique name for the object, generally using the value of one ofits prominent properties.

    Records the operation that you performed on the object using theappropriate Quick Test test object method.

    For Example, suppose you click on a Find button with the following HTMLsource code: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 followingproperties 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 ObjectSpy displays the selected objects hierarchy tree and its properties and valuesin 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 cancheck an area of a Web page or application as a bitmap. While creating a testof component, you specify the area you want to check by selecting an objectyou can check an entire object or any area within an object. Quick Testcaptures the specified object as a bitmap, and inserts a checkpoint in the testor component. You can also choose to save only the selected area of theobject 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 userspecifies. The map has control keys for zooming. You can record the new map

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    25/32

    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 (aslong as the appropriate add-ins are loaded).Note: The results of bitmap checkpoints may be affected by factors such asoperating 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 passedFrom 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, oriteration, Quick Test uses a different value from the Data Table

    Environment variables parameters enable you to use variable values fromOthers sources during the run session. These may be values you supply, orvalues that Quick Test generates for you based on conditions and options youchoose.

    Random number parameters enable you to insert random numbers asvalues in your test or component. For example, to check how your applicationhadles small and large ticked orders, you can have Quick Test generate arandom 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 soexplain?

    A). Batch Testing in WR is nothing but running the whose test set by selectingRun 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 thisprocess 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 systemIs working fine

    19.What does it mean when a check point is in red color? What do youdo?

    A). A red color indicates failure. Here we analyze the cause for failure whether itis aScript 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

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    26/32

    21.How do you create new test sets in TDA). Login to TD.

    Click on Test Lab tab.Select the Desired folder under which we need to create the test set. (Testsets 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 soexplain?

    A). You can use Test Batch Runner to run several tests in succession. The results foreach test are stored in their default location.

    Using Test Batch Runner, you can set up a list and save the list as an .mtbfile, so that you easily run the same batch of tests again, at another time. Youcan also choose to include or exclude a test in your batch list from runningduring a batch run.

    23.How to Import data from a .xls file to Data table during Runtime.A). Datatable.ImportXLS 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 whichaction iterationsWill be performed. Valid only when the IterationMode is rnfIterations. Enterthe row range

    (i.e 1.7); or enter rngAll to run iterations on all rows.If the action called by the RunAction statement includes an ExitActionstatement, the RunAction.Statement can return the value of the ExitActions 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 inWinRunner

    (c)QTP has Active Screen support which captures the application notavailable in WR.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    27/32

    (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 towith 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 sheetofThe 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 canCompare the expected values of object properties to the objects currentValues during a run session, If the results do not match, the checkpointFails.

    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 byyour application.The results displayed for table and database checkpoints are similar. Whenyou run test orComponent, Quick Test compares the expected results of the check points tothe actual results ofThe 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 addinga table.Chechpoint to your test or component. For Activex tables, you can also checkthe properties ofThe 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 forvariefy ofExternal add-in environments.You can use database checkpoints in your test or component to checkdatabases accessed by yourWeb site or application and to delete defects. You define a query on yourdatabase, and thenYou create a database checkpoint that checks the results of the query.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    28/32

    Database checkpoints are supported for all environments supported by QuickTest, by default, asWell as for a variety of external add-in environmentsThere are two ways to define a database query

    (a)Use Microsoft Query. You can install Microsoft Query from the custominstallation of Microsoft

    Office.(b)Manually define an SQL statement.The checkpoints timeout option is available only when creating a tablecheckpoint. It is notAvailable 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 byselecting an object. You can check an entire object or any area within anobject. Quick Test captures the specified object as a bitmap, and inserts acheckpoint in the test or component. You can also choose to save only theselected area of the object with your test or component in order to save diskspace.

    When you run the test or component, Quick Test compares the objector selected area of the object currently displayed on the web page orapplication with the bitmap stored when the test or component was recorded.If there are differences, Quick Test captures a bitmap of the actual object anddisplays it with the expected bitmap in the details portion of the Test Resultswindow. By comparing the two bitmaps (expected and actual), you canidentify the nature of the discrepancy. For more information on test results ofa checkpoint, see Viewing Checkpoint Results.

    For example, suppose you have a web site that can display a map ofcity the user specifies. The map has control keys for zooming. You can recordthe new map that is displayed after one click on the control key that zooms in

    the map. Using the bitmap checkpoint, you can check that the map zooms incorrectly.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 thechecked text. These configuration options are particularly helpful when thetext string you want to check appears several times or when it could changein a predictable way during run session.

    Note: In windows-based environments, if there is more than one lineof 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 textbefore and after the checked text in blue. For text area checkpoints, only thetext string captured from the defined area is displayed (Text Before and TextAfter are not displayed).

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    29/32

    To designate parts of the captured string as checked Test and other

    parts as Text Before and Text After, click configure button. The ConfigureText Selection dialog box opens.

    Checking XML :

    XML (Extensible Markup Language)is a meta-makeup language for textdocuments that is endorsed as a standard by the W3C. XML makes thecomplex data structure portable between different computerenvironments/operating systems and programming languages, facilitating thesharing of data.

    XML files contain text with simple tags that describe the data within anXML document. These tags describe the data content, but not thepresentation of the data. Applications that display an XML document or fileuse 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 XMLcheckpoints. 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 retrievecommonly used data for which a quick response times is needed-for example,country names, zip codes, or area codes. Although this data can change overtime, it is normally quite static. You can use an XML file checkpoint to validatethat 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 theelements, and elements can have attributes associated with them. If any partof this structure (including data) changes, you applications ability to processthe XML file may be affected. Using an XML checkpoint, you can check thecontent of an element to make sure that its, attributes, and values have notchanged.

    XML files are often an intermediary that retrieves dynamically

    changing data from one system. The data is then accessed by another systemusing Document. Type Definitions (DTD), enabling the accessing system toread and display the information in the file. You can use an XML checkpointand parameterize the captured data values in order to check an XMLdocument or file whose data changes in a predictable way.

    XML documents and files often need a well-defined structure in orderto be portable across platforms and development systems. One way toaccomplish this is by developing an XML scheme, which describes thestructure of the XML elements and data types. You can use scheme validationto check that each item of content in an XML file adheres to the schemedescription 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 appropriateobject repository mode for each test, you need to understand the differencesbetween the two modes.

    In general, the object repository per-action mode is easiest to usewhen you are creating simple record and run tests, especially under thefollowing conditions:

    You have only one, or very few, tests that correspond to a givenapplication, interface, or set of objects.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    30/32

    You do not expert to frequently modify test object properties.You generally create single-action testsConversely, 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 fromtime to time and/or you regularly need to update or modify test objectproperties.

    You often work with multi-action tests and regularly use the Insertcopy of Action and Insert Call to Action options.

    36.Can we Script any test case with out having object repository? OrUsing Object Repository is a must?

    A). No. U can script with out Object repository by knowing the windowHandlers, 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 QTP6.0 used for backward compatibility.Parameters: The test set within Quality Center, in which test runs arestored. Note that this argument is relevant only when working with atest in a Quality Center Project. When the test is not saved in QualityCenter, 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 whenthe 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 withthe statement immediately following the most recent call out of the procedurecontaining the on Error Resumes Next statement. This allows execution tocontinue despite a run-time error. You can then build the error-handlingroutine 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    31/32

    41.How to open any application during Scripting?

    A). SystemUtil, Object used to open and close applications and processesduring a run session.(a). A SystemUtil.Run statement is automatically added to your test when yourun an application from the start menu or the Run dialog box while recordinga test.

    Eg: SystemUtil.Run Notepad.exeSystemUtil.closeDescendentprocesses (closes all the processesopened 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 inthe object Identification dialog box, Quick Test can also record a bank upordinal identifier for each test object. The ordinal identifier assigns the objecta numerical value that indicates its order relative to other objects with anotherwise identical description (objects that have the same values for allproperties specified in the mandatory and assistive property lists). Thisordered value enables QuickTest to create a unique description when themandatory 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.xls

    44.How to suppress warnings from the Test results page?A). From the Test results Viewer Tools>Filters>Warningsmust beUnchecked.

    45.When we try to use test run option Run from Step, the browser isnot 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 ofDecember 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 createdand 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.

  • 8/2/2019 qtpmaterialforbeginners-110103234815-phpapp01

    32/32

    50.How to make arguments optional in a function?

    A). This is not possible as default VBS doesnt 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 ofglobalsheet. Why?

    A). Inserting a call to action will only Import the columns of the Action called.