SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic Window Declaration

    User Sumitra (sumitra@prabodhan.com.nospam) posted:

    Hi,
    While doing automation , our window declarations are changing
    dynamically.
    We are not able to use objects within that window as it is changing
    at runtime.
    I want to know how to proceed if I need to fetch the contents of an
    "HtmlTable"
    as the name of the table and columns changes dynamically.
    I have tried to dynamically generate an inc file , but even after
    sucessfully generating it , I am not able to use
    it because script is referring to the old inc file which I have
    included earlier.
    Is there any command that can unload or load the inc's as per
    requirement or any other alternate method
    to sort out this problem?

    Thanks and Regards,
    Sumitra


    Post message: silktest@yahoogroups.com
    Subscribe: silktest-subscribe@yahoogroups.com
    Unsubscribe: silktest-unsubscribe@yahoogroups.com
    List owner: silktest-owner@yahoogroups.com
    URL to this page: http://groups.yahoo.com/group/silktest


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Window Declaration

    What do you need to do with the objects in the table once you capture them?

    MikeF

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

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Window Declaration

    Depending on what you want to do with the contents after you've captured them, you could capture them into variables. After all, window identifiers are really just fancy variables.

    Something like...

    May require a lot of iterations, depending on the table size. And if you know the basic size of the table, it may be more effective to create a record (and a LIST OF said record) to hold the table contents.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Window Declaration

    If I want to capture and use dynamic window objects I use the ClassOf function to get a specific kind of class.

    Like this:
    LIST OF WINDOW CheckForClass(DATACLASS dcClass) [ ] LIST OF WINDOW lwObjects //Use to store complete list of objects on the active page
    [ ] LIST OF WINDOW lwMatches //Use to store the returned LIST OF WINDOW
    [ ] WINDOW w //Designates the current window
    [ ] WINDOW wObject //Use to store the objects in the lwObjects LIST OF WINDOW
    [ ]
    [ ] w=Browser.GetActive() //Get the active window's name
    [ ] lwObjects = w.GetChildren () //Get a list of all of the objects on the screen
    [-] for each wObject in lwObjects //For every object in the LIST OF WINDOW
    [-] if (ClassOf (wObject) == dcClass) //If the Class of the stored object equals the class passes in
    [ ] ListAppend(lwMatches, wObject) //Append the object to a new LIST OF WINDOW
    [ ]
    [ ] return lwMatches //Return the values in the lwMatches LIST OF WINDOW

    Once you get the list of string for a specific class you can then retrieve text, click pushbuttons, or etc.


    I have also modified this function so it does not ask for a specific class as input, but instead goes thu every data type class that my application is using and sets a set of global list of strings to the captured objects class. This function however lets you maintain more control over what is being captured for you to work with.

    MikeF
    MikeF


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

  5. #5
    Junior Member
    Join Date
    Mar 2001
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Window Declaration

    User Sumitra (sumitra@prabodhan.com.nospam) posted:

    Hi dcreed,
    Yes, I want to get the contents from the table.
    I have captured the window declarations.
    Now the problem is when I enter anything in the table while running
    the script, the table declaration gets changed dynamically
    and as I am using the declaration which I have captured before
    running the script, the current table or the columns from it are not
    the same which I have used in script and hence my script fails.
    As I have written in earlier mail , I have captured declaration at
    run time and had created inc of it and but don't know how to use this
    inc as it is using the first inc.

    Thanks,
    Sumitra



    Post message: silktest@yahoogroups.com
    Subscribe: silktest-subscribe@yahoogroups.com
    Unsubscribe: silktest-unsubscribe@yahoogroups.com
    List owner: silktest-owner@yahoogroups.com
    URL to this page: http://groups.yahoo.com/group/silktest


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



  6. #6
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Window Declaration

    There's no way I know of to switch declarations on the fly except by using dynamic instantiation in your script a lot. Not declarations, but it is dynamic objects.

    Depending on how radically your HtmlTable objects are changing at runtime there are a couple of options open to you.

    One, prayer.

    Two. If all that's changing is that items are being added to the table or changed.... For example, if it's always Name, eMail, and Address as the three columns but the contents of those columns are changing each time, you could kludge together a collection of fake declarations to embed in your table declaration such as...
    Hint: there's nothing that says you can't have items in your window declarations that aren't really there on the page. The only problem is if you try to do something with the object at runtime.

    If the table is changing in terms of width and height each time through, you could do similar things as above with the fake window declarations. I've included a fake table here that I've used when desperate. You have to do a lot of careful manipulation and checking at runtime, depending on how you're trying to interact with the table.

    Three. If there are a limited number of possibilities, you can delcare all X number of possibilities and then put all of them into your declarations, such as...

    Of course, if X for possibilities is 14,000, ya might not want to consider this.

    Four. I don't even want to think about this as it involves making all of your tags variables and switching their values on the fly depending on what table you get presented with. A lot of very iffy logic...and it's too late to think about it without hurting myself.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

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 07:11 AM.

Copyright BetaSoft Inc.