Results 1 to 7 of 7

Thread: QTP automated testing on .net application

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

    Lightbulb QTP automated testing on .net application

    Hello all,

    I was wondering if someone could possibly shed a bit of light on the current problem i am having with my automated testing

    When recording a test on our system (Insight) to click on some drop down menu's on a policy application box, the lines of code recorded are as follows:

    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").VbFrame("fra(0)").Click 108,98
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").ActiveX("xComboList.xCombo").VbComboBox("cmbList").Select "Combined"
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").VbFrame("fra(0)").Click 39,84
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").VbComboBox("cboPlanType").Select "Commercial Combined "
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").Click 367,200
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").VbComboBox("cboSaleMethod").Select "Internet "
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").Click 344,227
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").Dialog("APPLICATION FORM").Click 122,29
    VbWindow("MDIMain").VbWindow("frmClientFastTrack_11").VbWindow("frmPolApp").Dialog("APPLICATION FORM").WinButton("OK").Click

    The problem i am having is with the areas in red, each time the test is performed and a new client and policy application box is opened the number after the underscore increases by 1 digit, thus causing qtp to stop.

    if the line of code is re-recorded the number on the above line of code has increased by 1 digit again.

    My question really is, is there a way to allow qtp to consistently recognize the drop down boxes and ok button each time the test is run?

    any help would be greatly appreciated.

    regards James.


  2. #2

    Re: QTP automated testing on .net application

    Have you tried substituting that part in the OR with a regular expression?


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

    Re: QTP automated testing on .net application

    Im not quite sure what you mean by that.

    Please could you elaborate or give an example of how i would go about substituting with a regular expression?

    regards James


  4. #4
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: QTP automated testing on .net application

    I think you should change the mandatory property QTP learn for window during recording or one more solution is add assistive property to learn by QTP for vb window.

    And one more solution can be delete the name property of the object in OR and add some other reliable property to identify that window.

    I am sure it will help you.

    Let me know, whether you get the solution and how?

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  5. #5

    Re: QTP automated testing on .net application

    You can replace everything after the underscore with a wild card (.*) if you are using DP. If you are using OR, you can just subtitute [0-9]+ instead. Like this:

    frmClientFastTrack_[0-9]+

    Remember to check Regular Expression in the dialog when you are doing this. This may be the best solution in your case. You can also try this (using DP):

    VbWindow("MDIMain").VbWindow("title:=frmClientFastTrack.*").VbWindow("frmPolApp").VbFrame("fra(0)").Click 108,98

    This should work if "frmClientFastTrack_11" is the title of your VbWindow.


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

    Re: QTP automated testing on .net application

    Thanks for all your replies to this.

    I shall try and modify my scripts now and let you all know how i get on.

    thanks once again.
    James.


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

    Re: QTP automated testing on .net application

    Quote Originally Posted by Anshoo_Arora View Post
    You can replace everything after the underscore with a wild card (.*) if you are using DP. If you are using OR, you can just subtitute [0-9]+ instead. Like this:

    frmClientFastTrack_[0-9]+
    I used the above advice and it has finally progressed my testing forward.

    thanks you very much for your help.

    James.


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