Results 1 to 3 of 3
  1. #1

    Regading \"On Error Resume Next\"

    how to use "On Error Resume Next"?
    I'm importing excel sheet from my local drive to QTP Datasheet. It (Excel sheet)contains 5 records of user name and Password fields. If first login fails, QTP should go and pick 2nd record to login to the application. The loop should continue till all the 5 records done.

    Please help me...


  2. #2
    Senior Member
    Join Date
    Jun 2007
    Toronto, Canada

    Re: Regading \"On Error Resume Next\"

    why do u need "On error resume next" to use different data from the imported excel sheet if login on application fails..

    all you have to do is create a DO loop or a FOR loop until you login succesfully..something like this

    For a=1 to <rowcoun> Step 1
    <insert code here to enter the uname and pwd on your app and click login>
    If <error message on your app for invalid login> Then
    Reporter.ReportEvent micpass, "< >","< >"
    Exit For
    End If

    replace anything in < > with your actual code

  3. #3

    Re: Regading \"On Error Resume Next\"

    Yes, Ambience, you are absolutely right.

    In case of LogIn Application fails - it should be coverage from TC code.
    'On Error Resume Next' is used only to capture and manage script or QTP codes Errors.
    QTP will never threat not correct Login as Error,
    and this line is irrelavante for this coverage.
    Even more: it is misunderstanding and not correct using of
    'On Error Resume next'




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 04:05 PM.

Copyright BetaSoft Inc.