InvokeRemotely Error

Class library usage, coding and language questions.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

InvokeRemotely Error

Post by atom » Fri Jun 17, 2011 12:02 pm

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?

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: InvokeRemotely Error

Post by atom » Fri Jun 17, 2011 12:09 pm

Infact my delegate creates a log file, and it was called - but seems ranorex somehow lost a reference to it

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: InvokeRemotely Error

Post by Support Team » Fri Jun 17, 2011 3:13 pm

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
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: InvokeRemotely Error

Post by atom » Mon Jun 20, 2011 9:17 am

Ok thanks, am using 2.2 version