javascripttestcomplete

Extending TestComplete: How to change cursor?



I wrote a TestComplete extension to update Keyword-Test signature from TestComplete in to an external tool. However, this action takes very long time. That's why I need to change the cursor from arrow to hour glass, and back to arrow after action is done. The module doing the opperation is writen in js.
If I try to use the following code, suggested by TestComplete code completition
Win32API.SetCursor(Win32API.IDC_WAIT);
I got the error "Object expected". I.e., the js in the TestComplete extension does not know About Win32API object, despite the code completition suggestion.
Ommiting the Win32API. prefix has the same effect. Trying to create appropiate object via
new ActiveXObject("SomeKindClass")
fails, because I am not able to find appropiate name for the class containing some methode to change cursor. (I tryed, Microsoft.Win32, Microsoft.Win32API, Win32, Win32API and some other non-sence names...)
SmartBears description on writing extentions seems to contain no hint about changing the cursor in a js ScriptExtension. Please appologize, if I overlook it.
Any suggestions are appreciated. Thanx in advice for your F1!

Edit:
A possible way to solve this is described bellow. However, I am not able to follow it to the end, because of lack of time. Perhaps someone can confirm or deny the correctness. That' would be great.
Steps:


Solution

  • It is impossible to show an hour glass from a TestComplete extension.
    The reason is, following quote, that comes from https://support.smartbear.com/testcomplete/docs/working-with/extending/script/creating/specifics.htm.

    "If your design-time action performs actions against the TestComplete main window (for example, minimizes the window, changes the window size and position, and so on), an error will occur. This happens due to specifics of thread organization in TestComplete."

    I guess, the "on so on" part includes changing the cursor…