cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Occasional Contributor

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 <> "Close"
Wend

But from last few days, the automation test failed a couple of times displaying the following error message in the log file:

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

 

Would someone please guide me what is the problem that is causing this issue, It is not happening everytime but you can say that it is happening 2 out of 10 times.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

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

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

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
1 REPLY 1
Community Hero

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

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

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================