Site Loader
Auckland, New Zealand
In this part we will discuss record and playback in Coded UI Testing for Web applications using Coded UI Test Builder . Here is the complete video Thanks for watching the video, please leave your comments if anything need to be improved in the video !!! Thanks, Karthik KK

Post Author: Karthik kk

3 Replies to “Record and playback in Coded UI for Web Applications”

  1. Hi Kartik,

    I have recorded and played back. playing back on first page is fine, but playing back on second page is failing. below is Error. Could you let me know what is missing here.

    Thanks,
    Raj

    Test Name: CodedUITestMethod1
    Test FullName: CodedUITestProject6.CodedUITest1.CodedUITestMethod1
    Test Source: c:\Users\Nithai\Documents\Visual Studio 2013\Projects\CodedUITestProject1\CodedUITestProject6\CodedUITest1.cs : line 27
    Test Outcome: Failed
    Test Duration: 0:00:07.3246745

    Result Message:
    Test method CodedUITestProject6.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: ‘Web’
    ControlType: ‘ComboBox’
    TagName: ‘SELECT’
    Id: ‘TitleId’
    Name: ‘TitleId’
    Failed to find any control that matched the search condition Id=’TitleId’ && Name=’TitleId’ && ControlType=’ComboBox’ —> 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.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, Boolean resetSkipStep)
    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
    — 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(Exception exception, IPlaybackContext context)
    at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String queryId)
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
    at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetUITestControlRecursive(Boolean useCache, Boolean alwaysSearch, 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.FindControlIfNecessary()
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyPrivate(String propertyName, Object value)
    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.c__DisplayClass3e.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.SetProperty(String propertyName, Object value)
    at Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlComboBox.set_SelectedItem(String value)
    at CodedUITestProject6.UIMap.RecordedMethod1() in c:\Users\Nithai\Documents\Visual Studio 2013\Projects\CodedUITestProject1\CodedUITestProject6\UIMap.Designer.cs:line 65
    at CodedUITestProject6.CodedUITest1.CodedUITestMethod1() in c:\Users\Nithai\Documents\Visual Studio 2013\Projects\CodedUITestProject1\CodedUITestProject6\CodedUITest1.cs:line 29

  2. also I used System.Threading.Thread.Sleep(5000); to ensure that coded UI is waiting for 2nd page to load.

    Thanks,
    Raj

  3. Hi Karthik,

    I am unable to record actions for web application and getting the error message “Element not available Additional Details: The control details were not specified.”

    I am using VS 2017 Enterprise edition and IE version is 10.

    Please provide your feedback.

Leave a Reply to Raj Cancel reply

Your email address will not be published. Required fields are marked *