| || |
Is there a setting for \"Cursor.GetType ( )\" to work ?
As long as I can remember from QA partner, if I use "Cursor.GetType ( )"
the function will return the current shape of cursor when the function is called. But it seems the function doesn't do the job in silktest which doesn't make any sense. Because it is too simple thing to be gone wrong. I am testing MFC based application. and When the cursor change it's shape that is time to move next step, in the script, but the shape of cursor is recognized as "POINTER" not "DELAY"( when it is shown as hour glass), the next step triggered too early.
Can you think of any reason why the "Cursor.GetType ( )" doesn't work ?
Re: Is there a setting for \"Cursor.GetType ( )\" to work ?
I think what you are experiencing is related the way windows deals with cursors. When you get the cursor type from within SilkTest, windows replies to give you the proper cursor type for the application your cursor is currently on. For example, if your mouse pointer was on top of SilkTest while running the GetType command, it would give you the proper cursor for SilkTest at that moment. It doesn't recognize that you would like to get the cursor type you would see over the application you're testing.
From online Help file: "The GetType method asks the application over whose window the cursor is resting what its cursor is."
What you need to do is make sure the cursor is over the application you're testing before you do a GetType(). To this end, you can do a wTestWindow.SetActive() then
wTestWindow.Click(1, xpos, ypos) to click somewhere in your window, which would more the cursor there. Then your Cursor.GetTyoe() should work properly.
Take a look at the online help file as well, it has some useful information.