SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tags change on dynamically captured objects.

    Brief history on the issue:

    We have a dynamic applet that we are testing. Really we are using it with silk more than testing it, but any way.... The applet can change appearance and parent child relationships of objects. It even changes the objects on the applet.

    How I have handled it is a series of recursive GetChildren () calls into a list of window. The next GetChildren () call comes from the next window object in the list. See http://www.qaforums.com/Forum1/HTML/003746.html for an example of the code I am talking about. It seems I have to do recursive calls because the GetChildren only grabs the immediate children of an object not it's grand children and beyond.

    The code works fine I bring up my applet I run a variation of the script from the above post that gathers all the handles of the objects on the applet. It then looks through the list for specific objects in the applet and puts them into a record of window. I can then refer to the object that I want by the field name of the record.

    The problem:

    This is all well and good until an object uses prior text as its tag. This prior text changes as the applet is used. This of course breaks the window handle that is stored in the field of the record.

    The prior text change is a known event that can be captured.

    Currently the solution is to requery the objects every time I know that the text will change.

    The applet is huge and contains lots of objects in very deep parent child relationships. It can take up to two minutes to query the applet. This has really slowed the tests down. Previously the applet returned an index for the object in question. Some change somewhere changed the dynamic tag to be prior text which caused me to have to change how often I needed to gather the object handles.

    Is there any way to change the tag that is used when dynamically gathering objects from a screen. For example from prior text (Text is 1 : ) to index #1. Or is there a way to modify the dynamic tag as it changes? For example (Text is 1 : ) to (Text is 2 : )?


    ------------------


    [This message has been edited by blacst (edited 02-07-2003).]

  2. #2
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tags change on dynamically captured objects.

    Maybe you could write a routine that would change "Text is 1 : " to "Text is * : "?



    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  3. #3
    Member
    Join Date
    Oct 2002
    Location
    Earth (I think!)
    Posts
    92
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tags change on dynamically captured objects.

    Query the windows, create an internal cache.
    Add some business logic to your code. You know when things will change based on actions. Update the cached data.

    This will be faster because your not polling the window, but manipulating your own data.

    This will be more complex because you introduce business logic within your code.

    One other way is to have "pointers" within the window tree, instead of querying the entire tree, you could start at pre-set spots and that would require fewer steps.



    [This message has been edited by Shane DeMorais (edited 02-07-2003).]
    Let go Luke!

  4. #4
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tags change on dynamically captured objects.

    James,
    Thanks for your fast reply. Sorry I took so long to get back to you. I probably should have mentioned what I have tried. Lord knows I mentioned everything else. I did try your approach. After spending more time than I care to admit on the code. I was able to programmatically alter the window handle from "Text is 1 : " to "Text is * : "?. But it seems that it takes the values as literals instead of wild cards as they would if they were used in a declared tag.
    Shane DeMorais,
    I am really storing the desired objects in a record of window after I find them once. I use them from the record after that. That works until the value being used as a tag changes. But you post inspired another thought on creating a new method that will just look till it finds the object in question. Once it does it can update the existing handle in the record of handles that I have already gathered. This could be called instead of the long running method to handle the more frequent updates that I need. It might shave off a little time.

    How does a GetChildren function decide what type of tag to use? And is there a way to influence the decision?


    ------------------

  5. #5
    Junior Member
    Join Date
    Jan 2003
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tags change on dynamically captured objects.

    I do a similar thing, in that I keep references to these window objects in some global variables. But when the tag changes, as you mentioned, these references change.

    Now, silktest identifies objects by it's path (i.e MainWin.panel.viewport.button) and tag but what if this path changes? Is there are way to keep a reference to these objects that is independent of path and tag (i.e having a reference in java to a JavaJFC Button, it's location doesn't matter)?

    ------------------

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tags change on dynamically captured objects.

    a2mawani,

    You can declare multiple paths if you actually declare the object. The trick is that you have to know what the paths will be. Unfortuatly I believe silktest uses path to find and identitfy objects. There was a pretty good post here recently describing this.

    I do the dynamic thing because I have no clue what the parent child relationship will be. I know there will be objects on a page that meet some criteria. (i.e. JavaJFC Button with the caption of "Push Me") But, I have know idea under what parent child relationship it will fall. (The developer went nuts with java applet frames and the customer loves them.)

    The control that I have a problem with is always the first JavaJFCTable.
    The table is alway first so using the index tag would work great but the GetChildren function insists on using the prior text as the tag. Unfortuantly the prior text changes everytime I press the "Push Me" push button from (Text is n : ) to (Text is n + 1 : ). Where n is a number and n + 1 is a new number.


    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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:36 PM.

Copyright BetaSoft Inc.