SPONSORS:






User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 10 of 37
  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    call to Click() stalls on GetRect()

    I'm a rookie at QA and SilkTest. Two months on the job, fresh out of school. Our company is developing a web portal application, and I'm stuck on something. I've written statements like "ThisPage.ThatButton.Click()" any number of times already in my career, but now I find a testcase is stalling, and when I look back at SilkTest as it's stalling, I see the small window showing the progress and see it stalled at ThisPage.ThatButton.GetRect(), sitting there until it apparently times out. At other times I've seen it saying ThisPage.ThatButton.Click(NULL, 18, 19), whereas I called it as Click() with no arguments.

    I noodled around the Reference Manual and saw that the arguments are for the mouse button, and the x and y coordinates of the button being clicked. Running in debug, I saw that in htmlpage.inc (I think that was the name, I'm home now and have to use just my memory of it) it stalled in the GetRect() method, which apparently is part of a process of locating the midpoint of the button window. OK, I follow the idea, but why would it stall?

    The testcase is a practice case, trying out a new idea I had of how to build it, and I ran it many times just fine before the problem started happening. And it succeeded a few times since it started stalling, but generally it stalls. I don't think I did anything to knock something over in the code and break it. I really haven't got a clue now where to go further. I looked for the ultimate source of Click() but couldn't find it.

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

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

    Re: call to Click() stalls on GetRect()

    A few queries regarding the post...

    1. Let us know what method of test scripting you are using ? I have a feeling it is record playback.
    2. How have you created your declarations file, that is using a Record Window declarations or using a Frame capture ?
    3. Can you also tell us whether the call ThisPage.ThatButton.Click(NULL, 18, 19) does pass anytime or not, this can tell us something about the correctness of the declaration. (Try passing the call ThisPage.ThatButton.Click() as you require no parameters if you just want to click the button.)
    4. What is the error that is displayed after the time out (that is after the stall silk logs error)?

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

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

    Re: call to Click() stalls on GetRect()

    Thanks for the reply. I'm back at work now, and I can check a few things.

    The script is written manually, not recorded.

    I did the Record Window Declarations to capture the content of the web page under test.

    The GetRect() call stalls for about 30 seconds, then the next call is to Click(NULL, 18, 19). That call lasts only several seconds. In the script it is simply Click() without arguments.

    I've just written it "quick and dirty" before, but I put the Click() into a do/except and the error I get is

    Error: Window '[HtmlImage]My Info' is not active

    The button at the top of the portal window is "My Info", with an image that the user clicks on. It takes you to the user's personal sign-in page.

    After writing an exception handler, the testcase no longer exits after the error, but goes on to the next call in the script, which uses SetText() to enter the username and password for login, but there it exits because the page didn't come up since the Click() cdidn't work.

    [Well, it just worked correctly the last time I ran through it -- but only once, and now it's again "not active"]

    I tried adding a line

    ThisPage.ThatButton.SetActive() but the compiler doesn't let me use the method for an image/button .

    In using the page manually, clicking the image does work, so I don't know in what way it's "not active". But that error message makes it clear why it's stalling.

    so the question is -- since it worked a number of times when I first started writing the testcase, why did it suddenly start seeing the button as inactive.

    I keep calling it a button, but I realize it's in the declarations as an htmlimage.

    And the application is under development, so maybe something in the current version on the testing machine in the lab is the actual problem, but I doubt it.

    A few minutes later -- in the manual I found there's an Agent option to verify that a window is active. I unchecked that, and now it works (well, it failed once with an error message that the mouse was off the screen (31011, 31026)!!)

    So this is a clue but it's getting beyond me now.

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

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: call to Click() stalls on GetRect()

    No, no no no no...

    This is not getting beyond you. You're doing very well in troubleshooting this. You called yourself a rookie, but your investigative technique and drive to figure this out are impressive.

    So, there are several options here, and you have excellent clues to work with.

    The issue is, do you want to get this to work, or do you want to know WHY it quit working, or both?

    You're dealing with something I deal with daily, as the web site I'm automating also uses "images" in certain cases rather than "buttons."

    So, on the question of "Why" the test fails, take your investigation in the direction of a great tool Segue has in the Help Menu. Open the Library Browser and note the three tabs. This help organizer shows you all the methods and functions you have at your disposal to code your tests.

    In this case you want the Methods tab. Scroll down till you find HtmlImage. Highlight it and this will show you the valid methods you can use to manipulate it.

    Also look in Help Index. Type HtmlImage and you will be taken to the HtmlImagle class. You'll find a wealth of information on dealing with HtmlImages.

    The way I am manipulating these buttons, table cells and menuitems that are images is by calling something like this:

    It's a bit of a "hack" but it is getting the job done. I must do this about 100 times in my script to navigate around. Just set it up as a function and pass it paramaters of what you want to click. It should work for you.



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

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

    Re: call to Click() stalls on GetRect()

    Well the error pointed you in the right direction. Always a good practice to handle errors. Apart from that just a tiny winy suggestion whenever playing around with Agent Options make sure you set them only at the places required (in the test script for example), and then reset them to original value. This is imperative.

    Cheers

    ------------------
    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: call to Click() stalls on GetRect()

    Well, what fun. I don't have an application to play with right now. The engineers have just got the next new build of the app ready and the lab machine is Ghosting back to its base state as I type.

    Anyway ...

    DJGray -- I see what your code does, I think. You basically write your own routine to generate the arguments and then call Click() with them, so you have control. I can see how a utility function would work.

    I had looked at the Library Browser already, but didn't think of the Help Index. That's good.

    And yes, I want to know why. The problem seems to me to be not so much one of finding the right coordinates as that at some point Silktest wanted the HtmlImage to be active before it would click it. I'm curious because I thought "active" was only a property of windows, if I can use the term for what I mean, knowing that all these little objects in SilkTest are "windows". I intend to look deeper into the question, but want to "catch you" if you're still there just now.


    witchcrop - thanks for the tip. I had made a note to myself to reset the Options, but the idea of setting in the script is very helpful.


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

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

    Re: call to Click() stalls on GetRect()

    Your 30-second time delay might be related the the values on the Agent/Option/Timing tab. By setting these at low values and unchecking everything on the Agent/Option/Verification tab you take over control of the test environment from Silk.
    Options sets or Agent commands can also available for this.

    Time limits in Silk's methods and functions don't always include the ability to return the instant a desired action is completed. Some of them will wait until the timer drops to zero before they return.


    John


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

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

    Re: call to Click() stalls on GetRect()

    OK, that's cool.

    Here's what I see in the Timing tab of Agent Options:

    Window timeout 5 sec
    Window retry 0.06
    Keyboard event delay 0
    Mouse event delay 0
    App ready timeout 180
    App ready retry 0.1

    None of those seem to jive with a 30 sec stall on GetRect(). And it was ususally about 30 seconds, but sometimes only 10 or 20 (but usually 30 +/- 3 or 4)

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

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

    Re: call to Click() stalls on GetRect()

    Can I reopen this one?

    Lots of other demands at work, and just getting back to trying to build the suite of tests for the web app.

    I've tried a few other things out of curiosity. I discovered that the good old SetText() method also seems to like to stall. I have to call ThisPage.ThatTextField.SetText("{sUserName}") and also ("{sPassword}") in almost evey testcase in order to log in to the portal. Back in SilkTest I can see it stall at AgentSetText("{sUserName}").

    I thought I would try something "standard" rather than an application in development, like running the same testcase statements for Yahoo's home page. SearchField.SetText("Pigs") and SearchButton.Click() stall the same way. So it's probably not our company's app.

    I tried the same testcases from another guy's machine, same results. So it's probobaly not the installation of SilkTest on my box (I had thought of reinstalling SilkTest). And neither of us has fooled around with options, so although I fear something like that is behind all this, at least both of us apparently have the same option set at work.

    And now it's really getting maddening. It used to stall out and then completely time out pretty regularly. Now it frequently will wait a LONG time and then GO AHEAD AND FILL IN THE TEXTFIELD!! I put a timer in the code and wrote the results to a log, and it varies from 5 seconds to as much as a minute and a half. Sometimes it does that "window is not active" error, too, without completing. So the consistency needed for detective work is somewhat lacking

    And sometimes it will click a button for me right away.

    What in the world can be going on here???

    DJGray - I apologize - I didn't try your code trick yet. I got to work and forgot to look at it again until I just saw it tonight at home. I emailed myself at work to remind me.

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

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

    Re: call to Click() stalls on GetRect()

    felecha

    You are doing excellent in troubleshooting. Well about the problem at hand. Let us give it a try. I've encountered similar issues at my workplace where the scripts(SilkTest) used to behave as oddly as possible. It stalled at methods like Select, SetText etc. The closest to the actual finding of cause was this, Processor speed. Yep !

    Let us know what is your machine configuration ... have seen Silk to popup trouble for processors faster than 900 mhz

    About tricks (you must have already tried it out) try pitching in a SetActive () and a SetFocus () before all the calls that make the app stall. SetFocus helps.

    Keep us posted. And I know what it feels to be driven nuts

    ------------------
    never say die

    [This message has been edited by witchcrop (edited 08-27-2002).]
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

 

 
Page 1 of 4 1234 LastLast

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:45 PM.

Copyright BetaSoft Inc.