2016-04-04 6 views
0

Ich versuche aufgezeichnet Testfälle zu laufen und seine mir diesen Fehler geben :(Coded UI - Die Wiedergabe konnte die Steuerung mit den angegebenen Sucheigenschaften finden

ich nicht in der Lage bin, dies zu verstehen

. Bitte helfen.

Test Name: CodedUITestMethod1 
Test FullName: CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1 
Test Source: d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\CodedUITest1.cs : line 30 
Test Outcome: Failed 
Test Duration: 0:00:23.5295373 

Result Message: 
Test method CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1 threw exception: 
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
TechnologyName: 'UIA' 
FrameworkId: 'Wpf' 
ControlType: 'Window' 
Name: 'C5K Setup' 
ClassName: 'HwndWrapper' 
---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. 
Result StackTrace: 
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IRPFPlayback.FindAllScreenElements(IScreenElement pScreenElementStart, String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth, Object[]& foundDescendants) 
    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindTopLevelWindowHelper(String queryId) 
    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindFromPartialQueryId(String queryId, Boolean resetSkipStep) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(String queryId) 
--- End of inner exception stack trace --- 
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context) 
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context) 
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context) 
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String queryId) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(String queryId) 
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.SearchTopLevelWindow(ISearchArgument topLevelSearchArg, String topLevelElementQueryId) 
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetTitleUpdatedTopLevelWindow(ISearchArgument topLevelSearchArg, String queryId, IList`1 windowTitles) 
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetTopLevelElement(Boolean useCache, Boolean useCacheOnly, ISearchArgument searchArg, IList`1 windowTitles, Int32& timeLeft) 
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg) 
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal() 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<Find>b__3a() 
    at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find() 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass3e.<GetProperty>b__3d() 
    at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) 
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName) 
    at Microsoft.VisualStudio.TestTools.UITesting.ALUtility.GetTechElementFromUITestControl(UITestControl uiTestControl) 
    at Microsoft.VisualStudio.TestTools.UITesting.ActionExecutorManager.GetActionExecutor(UITestControl uiControl) 
    at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate) 
    at Microsoft.VisualStudio.TestTools.UITesting.Mouse.<>c__DisplayClass6.<Click>b__5() 
    at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) 
    at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate) 
    at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, Point relativeCoordinate) 
    at CanopusCodedUITestProject.UIMap.CreateConfiguration() in d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\UIMap.Designer.cs:line 280 
    at CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1() in d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\CodedUITest1.cs:line 32 

Antwort

0

wie die Eigenschaften der UI-Komponente Sieht aus, auf dem Sie aufgezeichnet hat sich verändert und so ist es nicht in der Lage Ihre aufgezeichneten Aktionen auszuführen. Überprüfen Sie, ob die Suche Eigenschaften des Bauteils immer noch die gleiche ist wie bei der Sie haben aufgezeichnet.

0

Bitte sehen Sie die Linie unten in Ihrem Stack-Trace angezeigt:

Microsoft.VisualStudio.TestTools.UITesting.Mouse. 
Click(UITestControl control, Point relativeCoordinate) 

Dies bedeutet, dass die CodedUI auf ein Steuerelement zu klicken versucht, einen bestimmten Punkt auf dem Bildschirm. Aus irgendeinem Grund kann das Steuerelement, auf das es klicken soll, nicht gefunden werden. Vielleicht existiert zu diesem speziellen Punkt kein Knopf. Höchstwahrscheinlich unterscheidet sich die Bildschirmauflösung Ihres aktuellen Anzeigegeräts von der Bildschirmauflösung des Anzeigegeräts, das Sie für die Aufzeichnung dieser Tests verwendet haben.

+1

Ich weiß, das ist alt, aber im Allgemeinen Codierte UI-Tests beziehen sich nicht auf eine Koordinate oder einen Punkt auf dem Bildschirm, sie beziehen sich auf eine Koordinate auf dem Steuerelement. Wenn also eine Taste 20 Pixel breit und 10 Pixel hoch in der Mitte eines Bildschirms steht, ist die Koordinate ungefähr so ​​wie x = 4, y = 3. Es sind nicht die Bildschirmkoordinaten. Das Problem besteht nicht darin, die Kontrolle zu finden, und dafür gibt es viele Gründe. – Ewan