Unable to retrieve some row in a DataGrid.

427 views
Skip to first unread message

Siddhant Agarwal

unread,
Jun 24, 2014, 8:22:58 AM6/24/14
to teststa...@googlegroups.com
Hi,

I have a data grid that contains some 10 rows. Now each row is divided into 2 columns. i.e Key and Description. 
So,I want to retrieve a particular row in the DataGrid based on the key. For that I am doing something like this :

ListViewRow row = SomeList.Row("Key", key);

This same code is working at other places in my application where I have a list view control. But, in 1 scenario I am unable to retrieve
3 of the 10 rows in the grid. For rest of the 7 rows it works fine. I have already cross checked the value of key 4 to 5 times to make sure that is correct. Tried to debug
it also, but couldn't find the root cause. Its throwing Null Reference Exception every time. I have checked the List Instance also. Its not null. And the number of rows
that the list shows while debugging is also correct.

What could be the possible cause for this? 

Siddhant

Ivan Danilov

unread,
Jun 24, 2014, 11:35:08 AM6/24/14
to teststa...@googlegroups.com
I think exact stack trace of your first time exception will help with issue identification. Could you reproduce your problem when Tools -> Options -> Debugging -> "Enable Just My Code" is unchecked? (You may also have several false positive exceptions as well that are thrown and catched internally - just continue execution until you find exception in question).

Siddhant Agarwal

unread,
Jun 25, 2014, 8:46:57 AM6/25/14
to teststa...@googlegroups.com
Hey,

I haven't used this before. So, don't have any idea about it. I believe this is what you are talking about?

'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll'
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll'
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationClientsideProviders\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationClientsideProviders.dll'
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'Microsoft.GeneratedCode'
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'DynamicProxyGenAssembly2'
A first chance exception of type 'System.InvalidOperationException' occurred in UIAutomationClient.dll
'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'
A first chance exception of type 'System.Windows.Automation.ElementNotAvailableException' occurred in UIAutomationClient.dll
A first chance exception of type 'System.Windows.Automation.ElementNotAvailableException' occurred in UIAutomationClient.dll
The thread '<No Name>' (0x275c) has exited with code 0 (0x0).
The thread '<No Name>' (0x2644) has exited with code 0 (0x0).
The thread '<No Name>' (0x26bc) has exited with code 0 (0x0).
The thread '<No Name>' (0x1a50) has exited with code 0 (0x0).
The thread '<No Name>' (0x1ec0) has exited with code 0 (0x0).
The thread '<No Name>' (0x1afc) has exited with code 0 (0x0).
The thread '<No Name>' (0x1378) has exited with code 0 (0x0).
The thread '<No Name>' (0x1964) has exited with code 0 (0x0).
Step into: Stepping over property 'SomeProperty.get'.  To step into properties, go to Tools->Options->Debugging and uncheck 'Step over properties and operators (Managed only)'.
Step into: Stepping over method without symbols 'System.AppDomain.Flags.get'
Step into: Stepping over method without symbols 'Castle.Proxies.ListViewProxy.Row'
A first chance exception of type 'System.NullReferenceException' occurred in TestStack.White.dll
A first chance exception of type 'System.NullReferenceException' occurred in TestStack.White.dll

Ivan Danilov

unread,
Jun 28, 2014, 4:59:08 PM6/28/14
to teststa...@googlegroups.com
No, that seems like an output window text. Try to run your test under debug and capture stack trace of that NullReferenceException in TestStack.White.dll

Siddhant Agarwal

unread,
Jun 30, 2014, 6:27:48 AM6/30/14
to teststa...@googlegroups.com
   at TestStack.White.UIItems.ListViewRows.<>c__DisplayClass1.<Get>b__0(ListViewRow obj) in c:\Project\TestStack.White\UIItems\ListViewRows.cs:line 30
   at System.Collections.Generic.List`1.Find(Predicate`1 match)
   at TestStack.White.UIItems.ListViewRows.Get(String column, String value) in c:\Project\TestStack.White\UIItems\ListViewRows.cs:line 30
   at TestStack.White.UIItems.ListView.Row(String column, String value) in c:\Project\TestStack.White\UIItems\ListView.cs:line 111
   at TestStack.White.Bricks.DelegateInvoker.ActionInvokerWrapper`3.Call(Object[] args) in c:\Project\TestStack.White\Bricks\DelegateInvoker.cs:line 165
   at TestStack.White.Bricks.DynamicProxyInterceptors.Process(IInvocation invocation, CoreInterceptContext interceptedContext) in c:\Project\TestStack.White\Bricks\DynamicProxyInterceptors.cs:line 21
   at TestStack.White.Interceptors.CoreInterceptor.Intercept(IInvocation invocation) in c:\Project\TestStack.White\Interceptors\CoreInterceptor.cs:line 31
   
   This is the stack trace when I debug it with "Enable Just my Code" unchecked

Jake Ginnivan

unread,
Jul 1, 2014, 2:27:19 PM7/1/14
to Siddhant Agarwal, teststa...@googlegroups.com

This looks like a legit issue.

 

I have created https://github.com/TestStack/White/issues/249, can we move the discussion there.

 

Is this WinForms? If so, a failing test would be a great help.

 

Cheers,

Jake

--
You received this message because you are subscribed to the Google Groups "TestStack.White" group.
To unsubscribe from this group and stop receiving emails from it, send an email to teststack_whi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siddhant Agarwal

unread,
Jul 2, 2014, 1:47:16 AM7/2/14
to teststa...@googlegroups.com, siddhan...@gmail.com
Its a WPF app.I have replied on github.
Reply all
Reply to author
Forward
0 new messages