Can anyone please help me in this issue I am facing with ,
I am using Dev Express Extra Grid Windows application for testing and I am facing System.NullReferenceException exception and then if I click on Continue button the application crashes, Actually we have 2 grids in our application and if I try to enter data thru Test Complete 1 of the grid works fine but for other one the application fails and throws an exception error as
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at CSS.ProductInfo.MainForm.gridViewBenefits_CustomDr awFooter(Object sender, RowObjectCustomDrawEventArgs e)
at DevExpress.XtraGrid.Views.Grid.GridView.RaiseCusto mDrawFooter(RowObjectCustomDrawEventArgs e)
at DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter .DrawFooter(GridViewDrawArgs e, GridRowFooterInfo fi)
at DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter .DrawTotalFooter(GridViewDrawArgs e)
at DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter .DrawContents(GridViewDrawArgs e)
at DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter .Draw(ViewDrawArgs ee)
at DevExpress.XtraGrid.Views.Base.BaseView.Draw(Graph icsCache e)
at DevExpress.XtraGrid.GridControl.OnPaint(PaintEvent Args e)
at System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraEditors.Container.EditorContainer.W ndProc(Message& m)
at DevExpress.XtraGrid.GridControl.WndProc(Message&am p; m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
<system.windows.forms jitDebugging="true" />
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
By the way this application is still under development.So do you think is this developers side issue or my code or .....
If anyone can understand what does this mean for,please explain.
I remember when I worked with custom .NET grid I had a similar issue when I tried to explore some properties using object inspector. But it was rather accessing item() method when there was no items and so on.
You didn't paste you code, maybe we could figure out something. Maybe that's the data problem, which resides in that certain grid?
Maybe you should consult with your devs regarding accessing to the grid. In my situation the data reside in custom property so devs help was important.
Did you show this exception to your devs, anyway?
The problem is unlikely to be related to TestComplete, because I only see DevExpress and native .NET modules in the call stack. I think that's caused by a problem in the tested application and you'll probably be able to reproduce that without TestComplete too.
Allen - SmartBear Support
Yes I did show this problem to dev's they said when it is working with 1 grid it should even work with the other one and I am here with the attachment of my code and screen shots of it.
But Manually it works fine
Well, you can't assign a property value manually, so I still think it's somehow related to the application's code. In particular, the problem seems to be caused by custom footer created in the gridViewBenefits_CustomDrawFooter event handler. Let your developers try to assign the same value to the problematic property, just like you do in your script, but from the application's code. I suppose they'll see the same behavior. I don't know how the grid is implemented, but I believe there are two possible causes for this problem:
1. The assignment you perform is not valid: either due to the grid's state or due to the value you're trying to assign. One thing you should check (in addition to asking developers make the same assignment in their code for test purposes) is to check whether the same operation works correctly in some cases. If it is so, the problem is related to the control's state and you'll need to find the difference between cases when the control works correctly and cases when the exception occurs.
2. This can be a bug in the control. In this case, you should report it to Developer Express and they'll most probably ask you to provide them with a small sample with which the problem can be reproduced. The test code mentioned in #1 above should help you with that.
BTW, as a workaround, you can try using other approaches described in the "Selecting Cells in Developer Express XtraGrid" (http://smartbear.com/support/viewarticle/14584/) help topic to select the needed cell.
Allen - SmartBear Support