Forum Discussion

pawan_werulkar's avatar
pawan_werulkar
Occasional Contributor
2 years ago
Solved

"The window is disabled. The action cannot be executed" in log file while test runs successfully

I am working on windows app frequently got error " The window is disable can't excute action" for the test cases which are passed in previous execution, also I have incresed delay time but not work a...
  • AlexKaras's avatar
    AlexKaras
    2 years ago

    Hi,

     

    Below is an example of my approach.

    Actually, unless test code interacts with MyApplication.MainWindow, your sample code will not provide you with any help as it checks the state of MainWindow object only.

    Unless you are using latest TestComplete version and something was broken in it, "The window is disabled. [...]" message was always correct and meant that the target window is disabled and end-user cannot interact with it.

    You can get the name of the problematic window from Details pane of test log.

    Considering, that the problem is intermittent, it might indicate timing issue when your test code proceeds fast enough and target window/UI control that was blocked by, for example, some modal notification window, are not enabled back by system or your application's code.

    To resolve the problem: figure out exact window/control that is reported as disabled and then analyze how tested application behaves when it reaches this state and what does your test code. Ideally, it might help if you have an option to talk to developers and they can provide you with description of how windows/controls of your tested application are disabled and enabled for this tested functionality.