SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Member
    Join Date
    Apr 2007
    Location
    Charm City
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Multiple objects with same name

    I've been searching the board just about all day using combos of "Object same name" and "desc prog same name". I cant seem to find my answer so I would be grateful if someone might point me to the proper search criteria or possibly even answer my question. I've searched for the 2 year max and I just cant seem to locate a thread that addresses my issue.

    QTP Version: 9.1
    Addins Loaded: none
    Application Protocol Testing
    Any non-standard controls involved: none
    Problem details: Need to determine how I can know for sure that when I have two objects on a page in the same frame that I'm identifying the proper object using indexing with Descriptive Programming.
    What searches you have tried: see above
    Solutions you have tried: Well, it seems to work. I just don't know how I know for sure that I'm getting an exist(true) on the proper object.

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    London, U.K
    Posts
    1,804
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    [ QUOTE ]
    I've searched for the 2 year max and I just cant seem to locate a thread that addresses my issue.


    [/ QUOTE ]

    I've been searching for much longer than two years and I still can't find a thread that addresses my issues [img]/images/graemlins/smile.gif[/img]

    - What's the object?
    - What do you want to do with the object?
    - Any other unique properties?

  3. #3
    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: Multiple objects with same name

    The first thing to note is that using Index is a last resort in most cases. It's easy enough for your developers to monkey around with that screen so that an object that is index:=1 today might be index:=2 after your next deployment.

    So, find a more permanent property if you can. It's not always possible.

    Assuming you cannot find a more permanent property, then include index:=x in your descriptive properties (don't use x, use the actual index number.

    If you are not sure the actual index number, then just use your OR to learn the entire page (click the page with the learn "hand" and choose to learn all dependents. It should learn them in the same order they would be indexed. In the OR, the second one would have a "_2" after it's name, and so on.

    Just remember that indexes start with zero, so your first object is index:=0, second is index:=1, etc.

    That should get you started, I hope. If you need more info about descriptive programming, I'm sure you can find 300 threads on that with any search on these forums.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  4. #4
    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: Multiple objects with same name

    [ QUOTE ]

    snip...
    .
    I'm identifying the proper object using indexing with Descriptive Programming.
    ...
    I just don't know how I know for sure that I'm getting an exist(true) on the proper object.


    [/ QUOTE ]

    Well, thats the downside to using an Index to reference an object, and just asking the question, "does this object exist?" as your only validation. If you can't futher interact with the object, or extract some type of information from it to confirm its identity, you will always be unsure.

    But if you are asking how can you visually confirm the object being identified while interactively troubleshooting then you can try (which I have recently):
    <font class="small">Code:</font><hr /><pre>
    obj.MouseMove 10, 10 '10 pixels from the top and left corner
    wait 2 '3, 4 or 5 seconds
    </pre><hr />

    As the code executes the mouse will "hover" over the object selected by your DP statement for wait number of seconds (in the above example that DP statement would be assigned to obj).

    But here again, it could work as expected today and then fail tomorrow if another object in the same class is placed before it in the Index numbering scheme on the page.

    -Hope this helps, Terry Horwath

    P.S. Just to make this clear you execute the above statements after confirming that obj exists. Also note that if you have odd object load times on your page (as I do mine on a .NET app I am currently teting) that you might also need to wait on WaitProperty("visible", True... as well, because MouseMove() throws an exception in the case where the object exists but is not yet visible.

  5. #5
    Member
    Join Date
    Apr 2007
    Location
    Charm City
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    Crimney! I have indices all over the place. Many of our labels and webTable fields are not uniquely defined. Many don't have names or html id's and I have to identify them by using the innertext since I know for sure I don't want to use x,y. Our developers are "working on" naming the fields, but no eta and I have to build this framework regardless and prove the concept.

    Just to clarify, when I use index, an I not referring to the webTable index, not the tagIndex property?

    The mouse code will ease my mind and I thank you!

    I've been perusing the forum for better ideas but would welcome any advice that you all can give... (or something simple that I may be overlooking)

  6. #6
    Member
    Join Date
    Apr 2007
    Location
    Charm City
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    Terry,

    It seems that the mouseMove is only for Active X controls.

  7. #7
    Senior Member
    Join Date
    Oct 2005
    Location
    London, U.K
    Posts
    1,804
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    Use :

    Obj.highlight

    Is your screen dynamic? Are there always same amount of objects, or could they differ ?

  8. #8
    Member
    Join Date
    Apr 2007
    Location
    Charm City
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    The screen should not change unless we have a new release (although one day I found that my links became a table!)
    I'll give hilight a shot.
    Ugh! Realization has set in about how ugly this could get... I used the OR to learn the page of objects and I have 18 unidentified webTables, 17 topofPages, and 35 fields that have between 5-11 indices.
    I'm solo doing a Proof of Concept on Desc Prog because right now some of the team likes checkpoints and the OR and I'm concerned that its a maintenance nightmare. I know that a bunch of you *know* my pain...

  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: Multiple objects with same name

    [ QUOTE ]
    It seems that the mouseMove is only for Active X controls.

    [/ QUOTE ]

    hum...

    Well, I am using QTP 9.2 and, according to online help, MouseMove is supported for several other technologies, in addition to activeX. For sure it is supported for .NET swfBlah objects. But it does not appear to be supported for web objects.

    [ QUOTE ]

    use obj.highlight


    [/ QUOTE ]

    hum2...

    I find no online help entry for a .Highlight method. Did you mistype that suggestion? (I would be interested in a more general purpose "hover").

    -Terry Horwath

  10. #10
    Member
    Join Date
    Apr 2007
    Location
    Charm City
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple objects with same name

    I get "object doesnt support this method" error both both.

 

 
Page 1 of 2 12 LastLast

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 10.71%
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 06:30 AM.

Copyright BetaSoft Inc.