SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Location
    mumbai
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Painted controls

    Hi,

    AUT(Application under test) has a lot of painted controls on its window.QTP does not recognise them. How do I solve this problem?


    Any pointers or clues appreciated.

    Cheers
    Minu

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    1. What technology are you working with, web, .NET, etc.? Is the AUT using a 3rd party add-on to implement these controls?

    2. What is the QTP test object class that encapsulates/contains these painted controls?

    3. Does QTP "see" an individual painted control when you click on it using the Object Spy? If yes, what is its QTP test object class?

    Those who have faced this problem using your technology (and posssibly the 3rd party controls) will need to this information to suggest solutions.

    -Terry Horwath

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Location
    mumbai
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    Hi,
    Here is the answer to ur queries.

    What technology are you working with, web, .NET, etc.? Is the AUT using a 3rd party add-on to implement these controls?

    Ans: Technology: VC++, COM, Custom Controls.

    2. What is the QTP test object class that encapsulates/contains these painted controls?

    Ans: Its a Window with painted controls

    3. Does QTP "see" an individual painted control when you click on it using the Object Spy? If yes, what is its QTP test object class?
    Ans: QTP (Object Spy) does not shows any information about these painted controls

    Those who have faced this problem using your technology (and posssibly the 3rd party controls) will need to this information to suggest solutions.

  4. #4
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    Try defining these painted controls as virtual objects. Look up Virtual Object in the QTP help files.

    I've used this approach very successfully in the past with painted controls like you describe.

    Essentially, you use QTP draw a box on the application window around one of the painted controls) and tell QTP that the area inside that box is a button (or whatever object class your painted control behaves like). From then on, QTP acts like that area is an actual object of whatever class you assigned it, and you can use normal QTP methods on it (so if you defined your area as a button, you could use .Click on that virtual button).
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  5. #5
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    Blake, I have not worked with virtual objects (yet). I am though curious and seeing that you have used them:

    1. Is the drawn box location's X, Y relative to the object (that QTP can "see") on which it resides?

    2. Is this technique screen resolution sensitive, or will the box scale as the screen res is changed?

    -Thanks, Terry Horwath

  6. #6
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    I'm pretty sure the x,y is relative to the window itself. Our server guys are mucking about with our QTP license server, so I cannot access QTP right now to look at my scripts.

    The virutal objects have height and width properties. These should be handled the same way Windows handles height and width of any other objects in various screen resolutions, but I haven't played with the resolutino or ported my scripts anywhere to test this yet.

    In my case, our current application uses a toolbar that QTP can see as a toolbar, but QTP doesn't see the individual buttons on the toolbar. So recording .Toolbar.Click does nothing at all. So I defined virtual buttons for each object in the toolbar, and I can reuse those anywhere in my script, even to the extent that they appear in the function generator and I can autocomplete methods using these virtual object.

    All I did was create a reusable action for the toolbar (the virtual definitions stay with the action). I pass parameters to this action from any other action to tell it which button to push. This way, I don't have to define the virtual buttons in every action that needs them - just the one reusable action.

    I'm dreading the day I have to port these scripts to our lab machines and try them on different resolutions...
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  7. #7
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    Thanks for this info Blake. I have a similar .NET toolbar that I have yet to deal with. Once you port and test resolution sensitivity issues please try and remember to update this thread. I will do the same if I beat you to it.

    It will also be interesting to see if the approach solves the original poster's issue.

    -Terry

  8. #8
    Junior Member
    Join Date
    Aug 2005
    Location
    mumbai
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    Thanks for ur suggestions but I still have two problems:

    1. The painted control embedded in a winList can't be added by QTP as a Virtual object.


    2. However I could add a painted control which was in a window but Changing the main window dimensions results in Virtual object not being recognised. Bcoz QTP adds the virtual object 's coordinates relative to the window size.

    Is there a way to solve these two problems.?

  9. #9
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    [ QUOTE ]

    ...but Changing the main window dimensions results in Virtual object not being recognised. Bcoz QTP adds the virtual object 's coordinates relative to the window size.


    [/ QUOTE ]

    Without using the Virtual Object feature, I was afraid this would be the case--what a POS solution this provides (BTW, Segue's SilkTest offers a "virtual grid" you lay over an unrecongnized object, that then scales as the window AND the resolution is changed--hey Mercury! why don't you add this capability to QTP?).

    Anyway, back to the real world. You are quickly running out of options, and I suspect that you are going to have to live with the virtual object if you can't tab to your painted control(s) [have you tried this?]. Below is a link to some browser functions I have contributed awhile back, one of which is BrowserResize(), which allows you to specify the size of the browser when it is programmatically invoked. Using this, you will at least be able to have a browser that is of a size known to work with your Virtual Object defs for the painted controls:

    http://www.sqaforums.com/showthreade...age=0&vc=1

    But maybe some of the QTP experts like Tarun or Mark Smith will have some better alternatives...

    -Hope this helps, Terry Horwath

  10. #10
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Painted controls

    You're right. QTP won't create virtual WinList controls.

    Here's a solution I implemented for a WinList that QTP doesn't see:

    First, I used analog recording to record myself clicking the dropdown button, then clicking the first item. I created a second analog recording to click the dropdown button and select the second item. I created more analog recordings, one for each item in the list.

    My list changes dynamically, but that doesn't matter to the analog recording since it is clicking the item based on its location on the screen - the actual text of that item is irrelevent.

    Then I added all the analog recordings to my script within a case statement. Because each list item selection displays some result somewhere on the screen (not always the same part of the screen), I also added verification against each of those objects to make sure I got the results I expect. If I don't get the expected results, it might be because the devs moved stuff around in my WinList (which would mean I selected the wrong list item):

    Select Case Variable
    Case 1
    AnalogScript1
    (Check for valid results)
    Case 2
    AnalogScript2
    (Check for valid results)
    (etc.)
    End Select

    This solution is quite ugly, but it lets me (blindly) select anything I want from the WinList, and verifies that I got what I wanted.

    Not pretty, but serviceable.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:18 PM.

Copyright BetaSoft Inc.