SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jun 2006
    Location
    Scottsdale, AZ
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dynamically create Collection of Objects on Screen

    Is there a function in WinRunner that can dynamically create a collection of the objects displayed on the screen? QuickTest Pro has the ChildObjects method which allows for such, but so far I have not been able to find a comparable function in WinRunner.

    To better ellaborate what I am looking for I will explain how the ChildObjects method works in QuickTest Pro. By specifiying the parent object and child description, you can assign a collection of child objects that meet the child description to a variable.

    Example:
    Set OBJECTS = Browser("browser").Page("page").ChildObjects(DESCR IPTIONS)

    Where OBJECTS is the variable the collection is assigned to, Browser("browser").Page("page") is the parent object (in this case a web page in a browser), and DESCRIPTIONS is a variable assigned by a previous descriptive programming statement which set it to an object type such as a LINK, BUTTON, DROP DOWN, etc.

    If DESCRIPTIONS is a LINK, OBJECTS will contain a collection of all the LINKS on the web page.

    I am looking for a similiar function in WinRunner. Does such a thing exist?

    Any help is appreciated!

  2. #2
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically create Collection of Objects on Screen

    Not inherently.

    You can iterate through a type of control with the location or index property and build your own hash/array of information.
    Insanity: doing the same thing over and over again and expecting different results

  3. #3
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically create Collection of Objects on Screen

    You have to admit it's more elegant in QTP.

  4. #4
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically create Collection of Objects on Screen

    No arguments there.

    Still don't like QTP, but I can't argue that it has a few stronger points in some areas (example above and stronger REGEX capabilities). Still think WR is better in the long run though
    Insanity: doing the same thing over and over again and expecting different results

  5. #5
    Junior Member
    Join Date
    Jun 2006
    Location
    Scottsdale, AZ
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically create Collection of Objects on Screen

    [ QUOTE ]
    Not inherently.

    You can iterate through a type of control with the location or index property and build your own hash/array of information.

    [/ QUOTE ]

    Is it possible to do this without a GUI Map, or with generic GUI Map entries? My goal is to generate a report of objects currently displayed on the screen, without having to specify the objects in the GUI Map.

    I haven't been able to find anything that can help me in the forums so far, but I might not be searching by the right keywords.

    Can either of you guys point me to an existing thread, or possibly provide a code example of the type of control you are describing, so that I can play around with it?

    Thanks for the replies!

  6. #6
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically create Collection of Objects on Screen

    <font class="small">Code:</font><hr /><pre>set_window("MyWebPage",5);
    index_num = 0;
    while(obj_exists(link = "{class: object,MSW_class: html_text_link,index: " &amp; index_num++ &amp; "}") == E_OK)
    obj_highlight(link)</pre><hr />

 

 

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 02:03 PM.

Copyright BetaSoft Inc.