diff --git a/src/TestStack.White/UIItems/UIItem.cs b/src/TestStack.White/UIItems/UIItem.cs index 5e2fe1e0..902b10d0 100644 --- a/src/TestStack.White/UIItems/UIItem.cs +++ b/src/TestStack.White/UIItems/UIItem.cs @@ -527,6 +527,18 @@ public virtual void ActionPerformed(Action action) /// Returns an if possibe public virtual IUIItemContainer AsContainer() { + return AsContainerInternal(); + } + + #endregion + + #region Internal + + internal virtual IUIItemContainer AsContainerInternal() + { + // This function needs to be internal because all public method from this + // class call interceptors. Sometimes we don't need focus on element, for + // example in GetMultiple method, so this method created for internal usage. if (Framework != WindowsFramework.Wpf) { Logger.Warn("Only WPF items should be treated as container items"); diff --git a/src/TestStack.White/UIItems/WPFUIItems/WPFUIItem.cs b/src/TestStack.White/UIItems/WPFUIItems/WPFUIItem.cs index 8d1ccd10..0c95cdc7 100644 --- a/src/TestStack.White/UIItems/WPFUIItems/WPFUIItem.cs +++ b/src/TestStack.White/UIItems/WPFUIItems/WPFUIItem.cs @@ -144,7 +144,7 @@ private static IUIItemContainer GetUiItemContainer(IUIItem uiItem) { throw new WhiteException("Cannot get UI Item container, uiItem must be an instance of UIItem"); } - return item.AsContainer(); + return item.AsContainerInternal(); } #endregion