cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
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

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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

1 REPLY 1
Community Hero

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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

Participate!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors