SPONSORS:






User Tag List

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

    Silk can\'t see a link but it can Click() it!!

    To all of you who have helped me so much, thank you so much! I'm new on the job, and it's a very big challenge, and lots of pressure to get things done, and you've got me over the hurdle more than once. I give this little note of appreciation because I see another of my topics with several contributions since I last checked in, and I don't want to seem ungrateful. It's just that that one is working whether I understand it or not, and I gotta go forward on stuff that isn't done yet!

    So here's another real burner. One of the popup windows of our web portal application has a list of links that you can click on. Whichever one you click calls a javascript that "expands" that item, displaying a short list of "sublinks". To test that it's working correctly, my plan has been to get Silk to click on a link, then call the GetChildren() method for the page, make a list of the names of all the HtmlLink objects on the page, and check to see that the names of the sublinks appear in that list.

    My problem has been that the list of links found by GetChildren()has not been including the expected expanded links. In other testcases I had already used the idea of getting a list of children and culling out the objects of the class I want. The line that I marked as crucial is because after getting frustrated with not finding the problem, I thought I would test whether I could get Silk to click on one of the expanded links. It does!!!. I've watched it again and again. The first link is clicked, I watch the expanded sublist appear, there's a brief pause, then the sublink is clicked and correctly acts the way it's supposed to and brings up the next page, but when I look at the printout, all the links are listed EXCEPT the expanded links that I want to verify. The int count is still zero. The except statement prints the error message

    I can't see how it can click on the sublink if it can't see it in a GetChildren() call.

    Any clues?

    [This message has been edited by felecha (edited 09-30-2002).]

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

    Re: Silk can\'t see a link but it can Click() it!!

    You code example needs a little formatting to clear it up.

    Please click on the Edit link near the top of your original post. Then click on the "UBB Code is..." link on the left side.

    Scroll down to the "code tag" near the bottom and apply the examples in red to your code block. That way its original formatting will be preserved and we-readers won't go blind trying to reinvent the indents.



    John


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

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

    Re: Silk can\'t see a link but it can Click() it!!

    That's better, I guess, but the code font is awfully small.

    Thanks. Always more to learn.

    F

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

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

    Re: Silk can\'t see a link but it can Click() it!!

    Thanks, that's much easier to read.

    The PopupWindow.GetChildren() method will gives you only the 'first-level' list of children. Silk will not recurse this list to show you the contents of every other container that might also exist within that initial list. To find those you must do a PopupWindow.kid.GetChildren().

    Here's a real-world example: Consider a window that contains a single popup menu that happens to be activated. A window.GetChildren() will list the popup menu but it will not show the menu items within that popup. However a window.popup.GetChildren() will show them.

    Modify your initial children loop to print our each 'kid' and its GetClass() return value. Look for the kid that represents the container for the sublinks. Then use that kid with a GetChildren() call to see those sublinks.

    Comparing the tag for this kid with your 'crucial" line should explain what that line works. Initially I'd say that that line is a dynamic instance call to that same kid with a specific sublink.


    John


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

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

    Re: Silk can\'t see a link but it can Click() it!!

    Well another way to go about it is GetContents. You can try out PopWindow.GetContents () It returns a list of strings with text identifying each of the items, preceding it with the class of the item. So it would return something like [PushButton]Next, [PushButton]Cancel etc. What's more with items with no caption GetContents () returns prior static text or the index number which would take off the additional overhead that you have to deal with. You can then handle the items as you need to.

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

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

    Re: Silk can\'t see a link but it can Click() it!!

    Well, friends, working is good.

    It didn't work to try to find the sublinks as children of the higher level links.

    But it did work to get the contents rather than the window's children. With a list of the contents, I could separate out what I wanted and make comaparisons, and it looks like a valid testcase.

    I also needed to verify that when the higher link was clicked, the little circle image to its left, that is empty before expanding, is replaced with a circle that's filled for the expanded link. There's a list of higher level links, and only one can be expanded at a time. It's not only evident which one is expanded, but the GUI designers added the little circle gif's "true.gif" and "false.gif", which are switched in and out by the javascript. Once again, the GetChildren() seems to be reading the contents of the window before the expansion, whereas GetContents() can correctly read the presence of the true.gif after the expansion.

    The code is a lot longer this way, but speed and memory are not a problem. Working is good.

    Really, thanks so much again. I don't think I'm at great risk of losing my job and my house and my children going hungry, but there is pressure here, and I just hate to sit and start at the screen feeling hopeless while the clock is ticking. I just don't know what to make of this one, but on to the next.

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

 

 

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 03:58 AM.

Copyright BetaSoft Inc.