SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anyone have problems with GetContents() sometimes finding nothing at all?

    I have a function I use to get the captions off of tabs in a web portal application. Tabs, like you see above on this very page of the QAForums. The function starts with a GetContents, and from that LIST of String I cull out the HtmlImage instances, and from those cull out the ones at a certain y-pixel location, and then do a GetCaption(). It has worked many times, but in a large number of testcases, it seems to get to the GetContents() and finds no contents at all and returns an empty LIST, so the rest of the testcase fails. It seems to run in "streaks" -- maybe 10 times in a row it will see no contents, then for a long time it will work fine. This is making a mess of my testing, of course.

    Anyone ever see inconsistency like that? Nothing changes in the testcase or the app.

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

  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: Anyone have problems with GetContents() sometimes finding nothing at all?

    When I do this I start with w.GetChildren() instead of GetContents() and it always works.

    w = current window

    MikeF

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

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Anyone have problems with GetContents() sometimes finding nothing at all?

    I have noticed a problem in my tests with GetChildren().
    On the off-chance I used GetChildren(true), and it worked fine.
    The default is not to include invisible windows in the return list. My child components are definitely visible.
    Bug...?


    ------------------
    Tempus fugit, Carpe Diem, et al

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Anyone have problems with GetContents() sometimes finding nothing at all?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by johntest:
    Bug...?
    <HR></BLOCKQUOTE>

    Not necessarily. HTML support has always been sensitive to timing - the first support for it and Java were both terribly slow. Possibly a waitforready or isenabled might help here?


    John


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

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Anyone have problems with GetContents() sometimes finding nothing at all?


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


    [This message has been edited by johntest (edited 11-15-2002).]
    Tempus fugit, Carpe Diem, et al

  6. #6
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Anyone have problems with GetContents() sometimes finding nothing at all?

    I first learned to get things with GetChildren(), then found once (can I remember back that far, what were the details?) that I was having a problem with it seeing something that I could see with my own eyes, and someone suggested GetContents(), which seems to run its thing a lot quicker and often has the info I'm really after, which is simply a caption, as in this case. So now that I sort of have an idea which function does what, I use GetContents() if I can. I was just baffled that it came up saying there were no contents at all. And then later it started seeing everything again. Yesterday afternoon I added a little Sleep() to make sure the function call waited till the page was there, and I haven't seen the problem since. So I'm guessing that was it. I've seen that happen before, needing a little extra time. I just didn't remember it till now.

    Thanks, all

    F

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


    [This message has been edited by felecha (edited 11-15-2002).]

  7. #7
    Senior Member
    Join Date
    May 2002
    Posts
    448
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Anyone have problems with GetContents() sometimes finding nothing at all?

    If my memory serves well in your case, where in you needed caption and winclass of the object GetContents () was more suitable then GetChildren (). However as you mention GetContents does some time behave the way you have seen. A Sleep () takes care of it.

    ------------------
    never say die
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

 

 

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 10:44 PM.

Copyright BetaSoft Inc.