Bricks Exception on some machines

Nov 26, 2009 at 1:48 PM

Ah Search To Folder dialog causes the problem:

th following Code is used


string[] startPath = { "Desktop", "Arbeitsplatz" };
      string[] pathArray = path.Substring(3).Split('\\');

      Tree tree = _searchFolder.Get<Tree>(SearchCriteria.ByControlType(ControlType.Tree).AndAutomationId("100"));


      TreeNode desktop = tree.Node("Desktop");
      TreeNode eigene = desktop.GetItem("Eigene Dateien");
      if (eigene.IsExpanded())

      TreeNode arbeitsplatz = tree.Node(startPath);

      TreeNode rootC = arbeitsplatz.Nodes.Where(p => Regex.IsMatch(p.Name, "(C:)")).First();

      //click OK Button
      UIItemElementHelper.ButtonCheck("1", _searchFolder, CheckType.ById, true).Click();

on some machines there is no problem, on some other

tree.ScrollBars.Vertical.SetToMinimum(); => leads to a NullReferenceExcpetion

if I don't use this line the Tests fail with a Bricks Exception on a TreeNode

I have no idea why this is a single machine problem :(

on all machines we use WinXP SP3 in german


Nov 29, 2009 at 5:41 AM

Can you provide the exception stack trace and message? As always log structure would help.

Mar 4, 2011 at 8:32 PM

I'm having this exception with the TreeNode, the exception happens with the methods Click(), Expand(), Collapse() and here is the stack trace for the expand one:

I noticed that if the Node is collapsed and I call GetItem("Existing item") I get null back, but if it's expanded I get the element back. But when I tried to expand it...  exception..


1]: Bricks.BricksException: Error invoking WPFTreeNode.Expand ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at White.Core.UIItems.TreeItems.WPFTreeNode.DoExpand()
   at White.Core.UIItems.TreeItems.TreeNode.Expand()
   --- End of inner exception stack trace ---
   at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfo, Object[] arguments)
   at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocation, InterceptContext interceptedContext)
   at White.Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at WPFTreeNodeProxyb77c4f6f405347de96b60a8abf548222.Expand()
   at Lookout.Tests.Acceptance.OutlookStart.FolderWithName_ShouldAppearInStore_(String folderName, String storeName) in E:\Dev\Lookout\src\LookoutAddin\Lookout.Tests\Acceptance\OutlookStart.cs:line 75
   at StoryQ.Operation.<>c__DisplayClass10`2.<Then>b__f()
   at StoryQ.Infrastructure.Step.Execute()

Bricks.BricksException : Error invoking WPFTreeNode.Expand
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfoObject[] arguments)
at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocationInterceptContext interceptedContext)
at White.Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at WPFTreeNodeProxyb77c4f6f405347de96b60a8abf548222.Expand()
Mar 4, 2011 at 9:01 PM

Also, if this helps, if I QuickWatch (debug) the TreeNode I can see that a BricksException is being thrown in SelectPoint property. Don't know if this is related.

The TreeNode I'm working with is Outlook 2007. This can be useful also

Hope to have any answer about this.