Forum Discussion

Rakeshyadav09's avatar
Rakeshyadav09
Occasional Contributor
6 years ago
Solved

This Operation was canceled because the method invoke timeout has expired.

Hello All,   I am using the following line of code to dynamically wait for an object: ' waits until the Close button gets enabled While hecrasExe.frmCompute.vbObject("cmdClose").Caption <> "Cl...
  • AlexKaras's avatar
    6 years ago

    Hi,

     

    > But from last few days [...]

    a) What has changed these days? (Version of TestComplete, version of tested application, Windows updates, etc.)

    b) Did you provide exact code that is used in the production? If you are, then I would recommend to put a small delay to let system process events/changes. E.g.:

    While hecrasExe.frmCompute.vbObject("cmdClose").Caption <> "Close"

      Call Delay(500)
    Wend

     

    c) Instead of the above loop you may consider to use the .WaitProperty() method. I.e.:

    If (hecrasExe.frmCompute.vbObject("cmdClose").WaitProperty("Caption", "Close", 30000) Then

      ...

    Else

      ...

    End If