2017-02-27 2 views
2

ich den folgenden Fehler auf halben Weg durch meinen aufgezeichneten codierten UI-Test in winforms bekommeUITestControlNotAvailableException in einem Test der codierten UI

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException: The following element is no longer available: Name [], ControlType [Window], NativeControlType [window], ClassName [WindowsForms10.Window.8.app.0.2a125d8_r17_ad1], RuntimeId [197812] Additional Details:

Mein erster Gedanke war, dass es etwas mit der Tatsache zu tun hatte, dass ich versuchen, auf ein Steuerelement in einem modalen Fenster zuzugreifen (durch ShowDialog angezeigt), aber ein eigenständiges Projekt hat mich falsch dargestellt. Ich habe wirklich keine Ahnung, wie ich das beheben kann. Es ist ein kleiner Verdacht, dass in der Fehlermeldung kein Kontrollname vorhanden ist.

Ich erhalte den folgenden Fehler auf halben Weg durch meinen aufgezeichneten codierten UI-Test in winforms

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException: The following element is no longer available: Name [], ControlType [Window], NativeControlType [window], ClassName [WindowsForms10.Window.8.app.0.2a125d8_r17_ad1], RuntimeId [197812] Additional Details:

Mein ersten Gedanke war, dass es etwas mit der Tatsache zu tun hatte, dass ich eine Steuerung zuzugreifen versuchen in einem modalen Fenster (durch ShowDialog angezeigt), aber ein eigenständiges Projekt hat mich falsch gedeutet. Ich habe wirklich keine Ahnung, wie ich das beheben kann. Es ist ein kleiner Verdacht, dass in der Fehlermeldung kein Kontrollname vorhanden ist.

EDIT: Protokollierung hinzugefügt, also hier sind einige weitere Details. Das hat wahrscheinlich etwas damit zu tun, dass das Fenster ein Dialog ist.

Type 'cipher' in 'tbxFedId' text box0:00.376 
The following element is no longer available: Name [], ControlType [Window], NativeControlType [window], ClassName [WindowsForms10.Window.8.app.0.2a125d8_r17_ad1], RuntimeId [4260726] Additional Details: TechnologyName: 'MSAA' ControlType: 'Edit' 
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException 
at Microsoft.VisualStudio.TestTools.UITesting.Playback.AddUITestControlDescriptionToException(Exception exception, IPlaybackContext context) 
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, IPlaybackContext context) 
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String actionName, UITestControl uiControl) 
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String actionName, Object parameterValue, UITestControl uiControl) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyValue(String propertyName, Object propertyValue) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyPrivate(String propertyName, Object value) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl+<>c__DisplayClass180_0.<SetProperty>b__0() 
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod(Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetProperty(String propertyName, Object value) 
at Microsoft.VisualStudio.TestTools.UITesting.WinControls.WinEdit.set_Text(String value) 
at UI.Test.UIMap.RecordedMethod1() 
in C:\Users\pg2\Documents\Visual Studio 2015\Projects\ADTrack\UI.Test\UIMap.Designer.cs:line 68 
at UI.Test.CodedUITest1.CodedUITestMethod1() 
in C:\Users\pg2\Documents\Visual Studio 2015\Projects\ADTrack\UI.Test\CodedUITest1.cs:line 31 
The following element is no longer available: Name [], ControlType [Window], NativeControlType [window], ClassName [WindowsForms10.Window.8.app.0.2a125d8_r17_ad1], RuntimeId [4260726] 
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotAvailableException 
at Microsoft.VisualStudio.TestTools.UITest.Framework.AbstractUITestService.MapAndThrowException(Exception ex, IUITechnologyElement element) 
at Microsoft.VisualStudio.TestTools.UITest.Framework.AbstractUITestService.GetParent(UITechnologyElement element) 
at Microsoft.VisualStudio.TestTools.UITesting.WinPropertyProvider.IsDatagridElement(UITestControl uiControl) 
at Microsoft.VisualStudio.TestTools.UITesting.WinPropertyProvider.SetEditProperty(String propertyName, Object value) 
at Microsoft.VisualStudio.TestTools.UITesting.WinPropertyProvider.SetPropertyValue(UITestControl uiControl, String propertyName, Object value) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestPropertyProvider.SetPropertyValueWrapper(UITestControl uiControl, String propertyName, Object value) 
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyValue(String propertyName, Object propertyValue) 
Error HRESULT E_FAIL has been returned from a call to a COM component. 
System.Runtime.InteropServices.COMException 
at Microsoft.VisualStudio.TestTools.UITest.Extension.IUITechnologyManager.GetParent(IUITechnologyElement element) 
at Microsoft.VisualStudio.TestTools.UITesting.UITechnologyManagerProxy.GetParent(IUITechnologyElement element) 
at Microsoft.VisualStudio.TestTools.UITest.Framework.AbstractUITestService.GetParent(UITechnologyElement element) 
The control : "Technology Name: 'MSAA';Search Configuration: 'VisibleOnly'; Search Properties - ControlType : 'Window',ControlName : 'tableLayoutPanel1',Instance : '2'" could not be found under the container : "Search Configuration: 'VisibleOnly'; Search Properties - ControlType : 'Window',Name : 'Employer Picker',ClassName : 'WindowsForms10.Window'". 
Technology Name: 'MSAA' 
Search Configuration: 'VisibleOnly' 
Search Properties - 
    ControlType : 'Edit' 
Value set : 'cipher' 
+0

Die Antwort in http://stackoverflow.com/a/27527105/546871 kann helfen. Der untere Abschnitt über die Verwendung mehrerer "DrawHighLight" -Aufrufe ist einen Versuch wert. – AdrianHHH

+0

Es kann jedes Steuerelement in der Hierarchie mit der Hervorhebung finden und dennoch den Text nicht eingeben. – PBG

+0

Ich konnte das Problem in einem separaten Projekt neu erstellen, und jetzt weiß ich, dass Telerik RadTextBox das Problem verursacht. Wenn ich sogar eine Lösung finde, werde ich updaten. – PBG

Antwort

0

Dies erwies sich 2015 ein Problem mit Visual Studio sein, war es funktioniert gut in VS 2012 und 2013

Falls es relevant ist, die spezifische Steuerung ich versuchte zu zielen ein RadTextbox.

Verwandte Themen