DevExpress Greed Cell value is empty.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Wed May 30, 2012 11:08 am

Code: Select all

Test method TestProject1.UnitTest1.TestMethod1 threw exception: 
Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:gridControl}'. ---> System.Runtime.Serialization.SerializationException: Failed to serialize return data from remote process.
Here is a test application and test method.
http://dl.dropbox.com/u/13579347/DXWind ... 2Btest.zip

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DevExpress Greed Cell value is empty.

Post by Support Team » Wed May 30, 2012 3:42 pm

Hello

thank you for providing us your project.

Well, the following code snippet worked well for us accessing the grid in your VS-Project.

Creating serializable return Type

Code: Select all

[Serializable]
private class SCellData
{
  public string aValue;
}
Code to get access to the DX-Grid with invoke remotely.

Code: Select all

Ranorex.Control MyControl = "/form[@controlname='Form1']/element[@controlname='gridControl']";
SCellData[] outputData = (SCellData[]) MyControl.InvokeRemotely (delegate (System.Windows.Forms.Control control, object input)
{
 DevExpress.XtraGrid.GridControl MyGrid = (DevExpress.XtraGrid.GridControl) control;
 List<SCellData> remoteOutputData = new List<SCellData>();  
                           				 
 // Iterate through your Rows/Cells
   SCellData MyCellData = new SCellData();
   MyCellData.aValue = "TestData"; //MyGrid. -> Get your cell Display Text here in a list
   remoteOutputData.Add (MyCellData);
 // End of Iteration
                            				
  return remoteOutputData.ToArray();
});
            
// Handle your outputdata
foreach (SCellData MyData in outputData){
  Ranorex.Report.Info("Values: " + MyData.aValue);
}
Of course you have to replace the pseudo-code for getting the values with real code for accessing the cells.
You are also able to extent serializable return type (SCellData) with other attributes like ColumnIdx or RowIdx.

Kind regards,
Roland (E)
Ranorex Support Team

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Thu May 31, 2012 7:42 am

I used your code in a test project (DXWindowsApplication1+test) and in real project, and still get the same error.

Code: Select all

Test method TestProject1.UnitTest1.TestMethod1 threw exception: 
Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:gridControl}'. ---> System.Runtime.Serialization.SerializationException: Failed to serialize return data from remote process.

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Thu May 31, 2012 1:13 pm

What this could be?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DevExpress Greed Cell value is empty.

Post by Support Team » Thu May 31, 2012 1:54 pm

Hi,

I just opened up your project (DXWindowsApplication1) and modified the invoking code (as described in my last post) and I managed it to invoke the DX Grid.

Please find your (modified) project attached. I just started the test from the built in Visual Studio Test Environment and it succeeded.

Do you use NUnit framework to start the testing process? Therefore the issue could be located there.
Please have a look at the following forum post: http://www.ranorex.com/forum/ranorex-co ... html#p3069

Especially take care of STA (Single Threaded Apartement) !

Kind regards,
Roland (E)
You do not have the required permissions to view the files attached to this post.

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Thu May 31, 2012 2:54 pm

In the test project, I run the application from the debug folder by hands. In a real project, I use Process process = Process.Start(). As a provider of test, I use MSTest. As a test framework SpecFlow.
I ran the test from your attachment, and got the same error. =(

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DevExpress Greed Cell value is empty.

Post by Support Team » Fri Jun 01, 2012 9:01 am

Hello,

we tried to run your project on another machine and we were able to reproduce this issue.

Your System Under Test has to have a Target .NET Framework greater than or equal to the testing project.
In your case,TestProject1 has .NET Framework 4.0 and DXWindowsApplication1 has .NET Framework 3.5. This does not work for Invoking!
If you change DXWindowsApplication1 to 4.0 this issue should be resolved.

Good luck!

Roland (E)
Ranorex Support Team

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Fri Jun 01, 2012 9:58 am

I successfully ran your example. But it was not able to achieve working in a real project. In a real project, I'm still getting the same error, but now I know where to look. If I extract code InvokeRemotely from specflow and run like you run a test project, then everything works. Need to somehow make friends specflow and [STAThread]

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DevExpress Greed Cell value is empty.

Post by Support Team » Fri Jun 01, 2012 10:26 am

Hi,

fine that you managed to come one step further.
Maybe, in order to use specflow in combination with Ranorex, you can have a look on that page: http://soft-test-tech.co.uk/2011/10/aut ... t-ranorex/

If you have any conclusion about that feel free to post it right here!
Good Luck

Roland (E)
Ranorex Support Team

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Fri Jun 01, 2012 10:31 am

http://soft-test-tech.co.uk/2011/10/aut ... t-ranorex/ does not help me. I use bundle of VS2010+Specflow+MSTest and everything works except for the InvokeRemotely method.

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Fri Jun 01, 2012 11:06 am

Here is a test project in bundle SpecFlow. SpecFlow installed via NuGet.

http://dl.dropbox.com/u/13579347/DXWind ... ecFlow.zip

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DevExpress Greed Cell value is empty.

Post by Support Team » Fri Jun 01, 2012 2:41 pm

Hi

did you check your Target .NET Framework in Project SpecFlowMSTest ?

If I "run SpecFlow Scenarios" the test "InvokeRemotely" passes, so it works very well.
I just changed the .NET Framework in that project to the same version that the other projects have.

If that does not solve you problem please point out in more detail what exactly you are doing
- How do you start wich tests?
- What's the result? Still the same exception? Is this the only error message you get?

Kind regards
Roland (E)
Ranorex Support Team

KapacRus
Posts: 30
Joined: Wed Apr 04, 2012 8:51 am
Location: Russia, Samara

Re: DevExpress Greed Cell value is empty.

Post by KapacRus » Mon Jun 04, 2012 8:46 am

Hi!

I change the .NET Framework to 3.5 and all working fine :)
Giant thanks for the help!