We have a treeview that sometimes takes a few seconds to load. While it is loading the mouse pointer is an hour glass. So I created this function that makes the script sleep when the pointer is an hour glass. I just call the function when ever I see that the app shows and hour glass. This one comes in very handy. I also have another function that I call that waits for the application to be idle before continuing. But that requires DLLs that we created.
Var Done = 0
CursorNumber = MouseCursor()
if CursorNumber = 3 or CursorNumber = 14
Done = 1
LogComment("Mouse Shape is: " + CursorNumber)
Loop While Done = 0
"If your not part of the solution, there's good money to be made in prolonging the problem."
If your not part of the solution, there's good money to be made in prolonging the problem.
With the TreeView you may be able to get away with using a TextSelect command to get QARun to click on the text within the control... when the text is not present, the script will initially fail until you set up an error handling routine.
Make the routine simply pause for x milliseconds and then return to the TextSelect line in your script where it just failed. Then allow it to try again. (cheap sync, but it's worked for me in the past).
ContrlFind( ) / CtrlEnabled( hCtrl )- Strategy looks very nice. But it don't works by me (Runtime error: 'Attached Window no longer exist', but it is in a focus and I used GridFind at a Grid and TreeViewFind at a TreeView. I don't know, why it is so.
But the WaitForNoHourGlass()-Function works. You should do Check at Grid before calling WaitForNoHourGlass().