Automated testing of grid controls

I''m trying to automate testing of our derived grid control using NUnit and NUnit Forms. One issue I have is that when I try to do a test that involves keyboard input, it''s failing because it''s trying to set focus to the grid as a whole instead of the cell in the grid, as each key is pressed. How can I get the System.Windows.Forms.Control reference of the current cell so that I can have NUnit Forms set the focus there for keyboard input? Pete

2 Replies

AD Administrator Syncfusion Team November 17, 2004 03:10 PM UTC

Not sure it will work for this setup, but you can try: this.grid.CurentCell.BeginEdit(); Or, maybe this.grid.CurrentCell.Renderer.Control.Focus(); You would probably need to check for nulls.


AD Administrator Syncfusion Team November 17, 2004 04:54 PM UTC

Thanks Clay. That will probably do it. Unfortunately, I''ve just discovered that NUnit Forms has no facility for me to pass it a Control object. It''s got a really screwed up architecture and wants a form and control name. Nor does it even store the actual control reference, so there''s no way to simply add a constuctor to pass in the control. Guess I''ve got some work to do. Thanks. >Not sure it will work for this setup, but you can try: > >this.grid.CurentCell.BeginEdit(); > > >Or, maybe > > >this.grid.CurrentCell.Renderer.Control.Focus(); > > >You would probably need to check for nulls.

Loader.
Up arrow icon