Page 1 of 1

InvokeRemotely Error

Posted: Fri Jun 17, 2011 12:02 pm
by atom
Hiya

Im automating a Dev Express XtraGrid
When the grid is displayed in the AUT, a background thread is kicked off to populate it
From automation point of view I have to wait for this background thread (which is loading from a database) to finish. So what i did was write a delegate method to invoke remotely, that simply loops waiting for no more rows. However when i call this method i get this error:

Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:fTradeGrid}'. ---> System.InvalidOperationException: The control does no longer exist. at Ranorex.Plugin.WinFormsFlavorElement.InvokeMethod(BindingFlags flags, String name, Object[] args) at Ranorex.Plugin.WinFormsFlavorElement.InvokeRemotely(RemotelyInvokedDelegate deleg, Object inputData) at Ranorex.Plugin.WinFormsFlavorElement.InvokeAction(Element element, String name, Object[] args) at Ranorex.Core.Element.InvokeAction(String name, Object[] args) --- End of inner exception stack trace --- at Ranorex.Core.Element.InvokeAction(String name, Object[] args) at Ranorex.Control.InvokeRemotely(RemotelyInvokedDelegate deleg, Object inputData) at SophisGUIAutoRanorex.Controls.Grid.DevExpress.DEXtraGrid.WaitForNoMoreRows(Int32 TimeOutSecs)

The control does definitely exist because I invoked remotely another method on it prior to this one.

Any clues?

Re: InvokeRemotely Error

Posted: Fri Jun 17, 2011 12:09 pm
by atom
Infact my delegate creates a log file, and it was called - but seems ranorex somehow lost a reference to it

Re: InvokeRemotely Error

Posted: Fri Jun 17, 2011 3:13 pm
by Support Team
Which Ranorex version do you use?
atom wrote:System.InvalidOperationException: The control does no longer exist.
With older Ranorex versions (prior 3.X), Ranorex would also issue that message if the control does not return a value to the InvokeRemotely call within 2 seconds. With Ranorex 3.X the Control.InvokeRemotely method now supports a timeout argument allowing to change the 2 seconds value.

Instead of waiting in the InvokeRemotely call, you can loop the InvokeRemotely call itself as a workaround.

Regards,
Alex
Ranorex Team

Re: InvokeRemotely Error

Posted: Mon Jun 20, 2011 9:17 am
by atom
Ok thanks, am using 2.2 version