Answered Questions

  • Recovery Scenario and On Error Resume Next

    What is the difference between 'Recovery Scenario' and 'On Error Resume Next'?

    Star Read Best Answer

    Editorial / Best Answer

    swapna.raut  

    • Member Since Dec-2009 | Dec 10th, 2009


    "On Error Resume Next" is used when you are sure about the step where the error can occur.

    Whereas, Recovery Scenario can be used to handle unxpected event or error.

    Basanagouda

    • Jul 20th, 2011

    Adding to aditya_12 answer If known errors we need to handle using line code (and code becomes lengthy) and same cannot be used in other part of script (unless made it as function) but recovery scen...

  • QTP Regular Expression

    What is the significance of regular expression in QTP?

    Star Read Best Answer

    Editorial / Best Answer

    priyankvyas  

    • Member Since Dec-2008 | May 6th, 2009


    Regular expression is always used to make our search globalize.

    To execute the test in QTP every object is searched in the object repository (OR). In real time applications some object's properties always keep changing, so at the time of execution script fails. To overcome it we use "regular expression" for that particular object's property. For example:

    1) Record a test where you are inserting one order and than faxing the same order.

    2) The order number that is generated during recording may 21 and "Fax Order window title" is generated and saved into OR as "Fax Order No. 21"

    3) Now execute the same test, the script will fail because this time order no is modified as 22 and accordingly "Fax Order window title" is modified as "Fax Order No. 22".

    4) This time the object "Fax Order No. 22" is not identified or you can understand object is not matched (find) into OR.

    5) To make this search better we modify the text property of object into OR as "Fax Order No.*" this will search all the occurrences of window that has text as "Fax Order No"

    6) We can also write it as "Fax Order No. [0-9]" because fax order no is a numerical value and this will search only numbers after "Fax Order No. "

    So this is the purpose of regular expression in QTP.

    aarati

    • Nov 9th, 2009

    Using RE we can make the QTP to recognize same object with its varying name.For example, a window having title as "Employee NO. 7"If I want to pass data to multiple Employee No. Windows, So I have to use RE as "Employee No..*" in Object Repository..

  • How to select desired dates using qtp in my application?

    In my application there is a date frame, and it acts like a link while choosing any date or month. Please tell me what would be the code so that QTP will automatically pick any date or month?

    nanavu

    • Jul 25th, 2008

    Normally, in the calendar frame the date links are keep in the table. So you have to loop through table, get the link object from each cell, then get the value of the link (maybe "text" depe...

  • how to solve error when QTP cannot identify object

    while running recorded application in QTP ,it gives errorCannot identify the object "OK" (of class WinObject). Verify that this object's properties match an object currently displayed in your applicationLine (3): "Window("Window").Window("Login").WinObject("OK").Click 32,10". can some pls give solution of this problem ,QTP gives this error for all drop down in application i recorded