Invoke Remotely Failure
Posted: Thu Apr 16, 2009 4:51 pm
I have this simple code:
[STAThread]
public static int Main(string[] args)
{
PluginManager.Instance.LoadDefaultPlugins();
Ranorex.Core.Element el = "/form[@controlname='MainForm']/element[@controlname='ribbon']";
Ranorex.Control ctrl = new Control(el);
ctrl.Click();
string value = (string)ctrl.InvokeRemotely(getSynchronisedRibbonObject);
return 0;
}
static object getSynchronisedRibbonObject(System.Windows.Forms.Control control, object inputData)
{
return "Test";
}
What I get is:
Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:ribbon}'. ---> System.InvalidOperationException: The control does no longer exist.
at Ranorex.Core.Element.InvokeAction
at Ranorex.Control.InvokeRemotely
at Ranorex.Control.InvokeRemotely
The control does indeed exist, as I click it before doing the invokeRemotely call. Can anyone see where I'm going wrong here?
[STAThread]
public static int Main(string[] args)
{
PluginManager.Instance.LoadDefaultPlugins();
Ranorex.Core.Element el = "/form[@controlname='MainForm']/element[@controlname='ribbon']";
Ranorex.Control ctrl = new Control(el);
ctrl.Click();
string value = (string)ctrl.InvokeRemotely(getSynchronisedRibbonObject);
return 0;
}
static object getSynchronisedRibbonObject(System.Windows.Forms.Control control, object inputData)
{
return "Test";
}
What I get is:
Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:ribbon}'. ---> System.InvalidOperationException: The control does no longer exist.
at Ranorex.Core.Element.InvokeAction
at Ranorex.Control.InvokeRemotely
at Ranorex.Control.InvokeRemotely
The control does indeed exist, as I click it before doing the invokeRemotely call. Can anyone see where I'm going wrong here?