Hi Symfony,
I am afraid that there is nothing Ranorex can make to get the background color of your cell controls.
The problem is that the MSAA representation of such a WinForms cell doesn't provide the background color and therefore Ranorex can also not identify it.
In order to get the background color of a cell you can modify the accessible implementation for such cells or you could also use the InvokeRemotely method to inject code in your AUT.
I created a samll sample with a normal WinForms grid, this grid control can be used to access each cell and to get the background color of the same:
Ranorex.Table table = "/form[@controlname='Form1']/table[@controlname='dataGridView1']";
Ranorex.Control myCtrl = (Ranorex.Control) table.Element;
// Invoke Remotely
string colorOfCell = (string)myCtrl.InvokeRemotely( delegate(System.Windows.Forms.Control control, object input)
{
System.Windows.Forms.DataGridView dataGrid = (System.Windows.Forms.DataGridView) control;
// There you can access each cell:
Color color = dataGrid.Rows[1].Cells[2].Style.BackColor;
Console.WriteLine("Color: "+color);
return color.ToString();
}
);
Report.Info("Color of Cell: "+colorOfCell);
To get more information of the InvokeRemotely method please take a look at the following blog:
Transfering data to and from a .NET control.
I hope this will help you to get a suitable solution!
Regards,
Markus