Results 1 to 3 of 3
  1. #1

    Getting Transaction details in runtime

    Hi All,

    Can we take the Transaction details in run time like for Eg;

    Services.StartTransaction "Start"
    Services.EndTransaction "Start"

    I want to take the time and display in msgbox or write it on notepad how much time taken to excute the CODE from StartTransaction to EndTransaction.


  2. #2

    Re: Getting Transaction details in runtime

    Hi Aduu,

    If you don't plan on running your QTP script from the LoadRunner controller you might be better off using the Timer function instead. For example this should work for you:

    StartTime = Timer
    EndTime = Timer
    runtTime = EndTime - StartTime
    Msgbox runTime

    Hope this helps.



  3. #3
    Advanced Member
    Join Date
    Aug 2006
    Other side of the Computer

    Re: Getting Transaction details in runtime

    If you want to use time in multiple place. use the following code.

    <font class="small">Code:</font><hr /><pre>
    Call fStartTimer("LoginTest")
    wait 6
    intLoginTime = fStopTimer("LoginTest")
    msgbox intLoginTime

    Public Function fStartTimer(strText)
    Dim intStartTime 'Holds timer value
    Dim l_strTmr 'Holds timer text

    l_strTmr = Replace(strText," ","")
    intStartTime = Timer 'Get the current timer
    DataTable.GlobalSheet.AddParameter l_strTmr, intStartTime 'Write the text parameter to the global datasheet
    End Function

    Public Function fStopTimer(strText)
    Dim intStopTime 'Holds timer value
    Dim l_strTmr 'Holds timer text

    l_strTmr = Replace(strText," ","")
    intStopTime = Timer 'Get the current time
    fStopTimer = FormatNumber(intStopTime - DataTable(l_strTmr,dtGlobalSheet),3) 'Find the time difference
    DataTable.GlobalSheet.DeleteParameter l_strTmr 'Delete the added paramater to the datasheet
    fStopTimer = fStopTimer 'Write to environment
    End Function

    </pre><hr />



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:13 PM.

Copyright BetaSoft Inc.