Results 1 to 6 of 6
  1. #1

    How to write performance test cases using QTP 9.2?

    I have a question about how can i use QTP 9.2 to write performance test cases, meaning that how can i make QTP get the timing of each step it performs during runtime?

    I have tried using "Object synchronization timeout" but it's not consistent !

  2. #2

    Re: How to write performance test cases using QTP 9.2?

    I can't remember if this method is available in 9.2. But check it out.


  3. #3

    Re: How to write performance test cases using QTP 9.2?

    Thanks RajKumar,

    They are actually still in 9.2

    This will help me in identifying the duration of each step during runtime, but what if I want to put a threshold on each step and interrupt/terminate my performance test with a failure status if that threshold has been exceeded ???

    Can anyone elaborate on how to achieve this using QTP 9.2 ??

  4. #4

    Re: How to write performance test cases using QTP 9.2?

    You may have to use MercuryTimers and function/logic to determine if it had exceeded the threshold.

    Then you could use EndTransaction with required status pass/fail based on that.

    Can you post some example steps/code to suggest any further?
    Kind regards,
    Anand Tambey

    RSS Feed : Break To Make it Better
    A Lazy person could be the best automation professional, if he is not lazy in implementing his ideas to reduce his work. ~Anand Tambey

  5. #5

    Re: How to write performance test cases using QTP 9.2?

    Guess you have to set the default time out property for every step, and once it exceeds the control will be passed to the next statment.
    Use Err objects to check if the scenario failed
    Report the result per your requirement.
    -- Here to Learn and share ---

  6. #6

    Re: How to write performance test cases using QTP 9.2?

    Just a word of caution - QTP isn't a very scientific way to measure performance as the speed in which it takes to measure your transaction times could depend on:

    - Other programs running on your machine, this will impact cpu and memory which in turn will impact the GUI you are automating.
    - The optimisation of your code between the transactions.
    - Other types of load happening on your application at the time (i.e are you in full control of the environment).

    Here is a synchronise function I have created - it will return true once the object is available. You need to pass into it a reference to the QTP object:

    <font class="small">Code:</font><hr /><pre>
    Function SynchroniseOnObject(objRepositoryItem, intMaxWait)
    Dim blnObjectFound : blnObjectFound = False
    Dim dtStart, intWaitedTime
    Dim blnBreak : blnBreak = false

    'get the current start time
    dtStart = now()

    'check if the object exists
    If objRepositoryItem.Exist(0) Then
    blnObjectFound = true
    blnBreak = true
    'otherwise wait - calculate how long we have waited so far
    intWaitedTime = datediff("s",dtStart,now())
    If intWaitedTime &gt; intMaxWait then blnBreak = true
    End if
    loop until blnBreak

    SynchroniseOnObject = blnObjectFound
    End Function
    </pre><hr />

    So if you wanted to call it for a webelement object which is already in your repository with a 90 second timeout:

    blnSynced = SynchroniseOnObject(Browser("application a").Page("page b").WebElement("element c"),90)

    And if you wanted to get clever, you could alter the function to return the precise time it took to identify the item (play around with the datediff function to capture the time)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:51 PM.

Copyright BetaSoft Inc.