Results 1 to 12 of 12

Thread: transaction code testing in QTP

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Smile transaction code testing in QTP

    Good day all,

    Currently in my testing i have reached a specific test i must carry out in the system whereby i must settle outstanding debts on the system by selecting the transactions from a list. The code is as follows:

    VbWindow("MDIMain_3").Window("Recon # 7455").ActiveX("InsSettle.ctlInsSettle").VbListView("lsvComm").Select "77405"
    VbWindow("MDIMain_3").Window("Recon # 7455").ActiveX("InsSettle.ctlInsSettle").VbListView("lsvComm").SelectRange "79012"
    VbWindow("MDIMain_3").Window("Recon # 7455").ActiveX("InsSettle.ctlInsSettle").VbButton("OK").Click
    VbWindow("MDIMain_3").Dialog("Payment Method").WinButton("Yes").Click
    VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Click
    VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Click
    VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Click
    VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Click


    The problem i am having is that when settling these transactions the list updates along with the transaction numbers (numbers after 'select' and 'selectRange') and also the last few lines of code show clicking on yes on a dialog box to accept the settlement, this box comes up for each transaction to be settled, and thus i need help with:

    a) how to get QTP to select a set amount of items on the list of transactions menu without the need to recognize the transaction numbers
    and
    b) How to make the above work so that i can set a certain number of box clicks.

    any help is as always greatly appreciated.

    James.


  2. #2

    Re: transaction code testing in QTP

    I read your question a couple of times but to me, things are still unclear.

    1. Are transaction numbers (numbers are SELECT and SELECTRANGE) dynamic? That is, do they change everytime the VbWindow refreshes/loads?
    2. What is the list of transactions menu?
    3. What determines the number of box clicks?
    4. Which list updates along with the transaction numbers? Are you talking about the Child Object VbListView("lsvComm")?

    Is it possible for you to provide me with a snapshot? If its not appropriate to post it here, could you mail it to me?


  3. #3
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Re: transaction code testing in QTP

    Ok i have a screenshot for you to view.

    the transactions listed in the window update each time a new policy transaction is carried out, however if no transactions have been carried out then this stays the same.

    The number of box clicks relates to the amount of transactions that have been selected to be settled.

    The list itself ~(i think it is child view) updates as above, when new policy transactions are carried out where there will be an amount owing to pay the policy.

    hope this is of some help.

    regards James.

    Attached Files Attached Files

  4. #4

    Re: transaction code testing in QTP

    a) how to get QTP to select a set amount of items on the list of transactions menu without the need to recognize the transaction numbers
    Would you like to store these set values in the DataTable? Or would you like to retrieve a value from the form and feed it here?

    If its the first one then:

    1. Make a column in the DataTable and name it let's say "someVal"
    2. sInValue = DataTable("someVal",dtGlobalSheet)

    If its the second one then there are several ways it can be done.

    b) How to make the above work so that i can set a certain number of box clicks.
    Wait(1)
    While VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Exist
    VbWindow("MDIMain_3").Dialog("Outstanding").WinButton("Yes").Click
    Wait(1)
    Wend

    You can remove the "Wait()" part. I have included that just in case it takes a second or so for the dialog to appear.

    I hope this is what you were looking for..


  5. #5
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Re: transaction code testing in QTP

    Hello,

    Id like to retrieve the value from the actual form itself as a data table is not really feasable at this stage of testing.

    the second part will be fine in regard to the dialog boxes so thank you.

    any help on the first point with regards to retrieving the value from the form would be of much help.

    regards James.


  6. #6

    Re: transaction code testing in QTP

    Try this:

    listVal = 1

    VbWindow("MDIMain_3").Window("Recon # 7455").ActiveX("InsSettle.ctlInsSettle").VbListView("lsvComm").GetItem(listVal)

    You can try this with listVal = 2, listVal = 3 etc.


  7. #7
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Re: transaction code testing in QTP

    Hello again,

    I have tried the code you gave and QTP advises that it cannot recognize the VBListView ( "lsvcomm").

    Have you any thoughts on this?

    thanks James.


  8. #8

    Re: transaction code testing in QTP

    It is possible that the VBList is a dynamic object, that is, its properties can change during runtime. Is it a dynamic object? If it is, then before we get any further, we will have to make sure QTP recognizes the List object every time the script is run.


  9. #9
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Re: transaction code testing in QTP

    Im not totally 100% on this, but i believe that it is not a dynamic object as there is not any reason for it to change.


  10. #10

    Re: transaction code testing in QTP

    James, I am not sure why it fails to work. I copied the code you posted in the original post. It should work. Maybe you can try to check if the VbList properties in the application and in your OR are the same?


  11. #11
    Junior Member
    Join Date
    Mar 2008
    Answers
    19

    Re: transaction code testing in QTP

    hello,

    sorry for the late reply,

    I have checked and it is the same in the or, however qtp advises that:

    Cannot find the "lsvComm" object's parent "Recon # 7455" (class Window). Verify that parent properties match an object currently displayed in your application.

    any ideas?

    regards James.


  12. #12

    Re: transaction code testing in QTP

    VbWindow("MDIMain_3").Window("Recon # 7455").ActiveX("InsSettle.ctlInsSettle").VbListView("lsvComm").Select "77405"

    There is the problem (the part in red). QTP is not able to recognize the part. Its probably because the part after Recon # changes at runtime. You can use a regular expression there or the .* wildcard.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact