views:

266

answers:

0

I am trying to automate the UI testing process using VSTS 2010 on Microsoft Dynamics AX 2009. Using coded UI test, I am recording tests on on Microsoft Dynamics AX 2009. Recording works fine, it runs into issue when trying to run the test recorded on TreeView control in the application. Tests fails to execute on that control. Following is the exception thrown -

The playback failed to find the control with the given search properties. Additional Details:

TechnologyName: 'MSAA'

ControlType: 'TreeItem'

Name: 'Inventory management'

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException was unhandled by user code

Message=The playback failed to find the control with the given search properties. Additional Details:

TechnologyName: 'MSAA'

ControlType: 'TreeItem'

Name: 'Inventory management'

Source=Microsoft.VisualStudio.TestTools.UITesting

BasicMessage=The playback failed to find the control with the given search properties.

HResult=-268111872

RootElement=""

StackTrace:

   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.FindFirstDescendant(String queryId, Boolean expandUIElementWhileSearching, Int32 searchTime)

   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.FindControlIfNecessary()

   at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Click(MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinates)

   at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)

   at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementationWrapper(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)

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

   at TestProject2.UIMap.RecordedMethod1() in c:\documents and settings\prasad.kamat\my documents\visual studio 2010\Projects\TestProject2\TestProject2\UIMap.Designer.cs:line 50

   at TestProject2.CodedUITest1.CodedUITestMethod1() in c:\documents and settings\prasad.kamat\my documents\visual studio 2010\Projects\TestProject2\TestProject2\CodedUITest1.cs:line 30

InnerException: System.Runtime.InteropServices.COMException

   Message=Error HRESULT E_FAIL has been returned from a call to a COM component.

   Source=Microsoft.VisualStudio.TestTools.UITest.Playback

   ErrorCode=-2147467259

   StackTrace:

        at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)

        at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException)

        at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth)

        at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId)

        at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElementByExpandingUI(ScreenElement parentElement, String queryIdString)

        at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Boolean expandUIElementWhileSearching, Int32 searchTime)

   InnerException: