Forum Discussion

Ryan_Moran's avatar
Ryan_Moran
Valued Contributor
10 years ago

Asynchronous object call failed.

for (var c = 1; c < 3; c ++) {
  Runner.CallObjectMethodAsync(Sys.Browser("chrome"),"Refresh");
  var tmp = Sys.Browser("chrome").Find("Name","*",1,false);
}

" Asynchronous object call failed." error when attempting to call find method on browser.

Seems to run fine the first time then subsequent calls will fail on the .Find method.

Anyone know why?

  • HKosova's avatar
    HKosova
    10 years ago

    Odd errors like that are best dealt with through a support ticket, because they need a dev to look at. But once again, your example is not a supported usage scenario, so it might turn out to be a "won't fix".

    • HKosova's avatar
      HKosova
      SmartBear Alumni (Retired)

      Off the top of my head, this may be because, as the Remarks say, CallObjectMethodAsync isn't designed for calling TestComplete object methods. It's mostly just for native methods.

      Plus, I don't think Refresh and Find can get along when running in parallel. Should be Refresh first, then Find; or Find(..., ..., ..., true).

      • Ryan_Moran's avatar
        Ryan_Moran
        Valued Contributor

        Thanks Helen,

        Yes that is what I would have logically concluded, but it's interesting to me that it seems to work without any issues for our .NET and Delphi applications. Perhaps just a timing issue? It's only with chrome (did not check other browsers) that it fails for me. Regardless, it would be nice if I could somehow continue processing my script without having to wait for the refresh method to return. In this case I don't really care if the object is found with the .Find method I simply want to handle this in my script and recursively call the method as quickly as possible until an object is found.