This is a migrated thread and some comments may be shown as answers.

TabControl for CodedUI

2 Answers 68 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Cameron Molyneux
Top achievements
Rank 1
Cameron Molyneux asked on 08 Nov 2012, 02:46 PM
Hi there,

I'm experiencing issues with CodedUI for the telerik control for Tabs in Silverlight. I can record what I do within a tab using the CodedUI, but when I come to executing the CodedUI Test its unable to pick out the controls within the telerik Tab Control container.

Not sure if there is a work around here. I had made a quick Visual Studio Solution that replicates the problem I'm experiencing.

Here is the exception Message

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException was unhandled by user code
  HResult=-268111872
  Message=The playback failed to find the control with the given search properties. Additional Details: 
TechnologyName:  'Silverlight'
ControlType:  'Edit'
AutomationId:  'TestMe'


  Source=Microsoft.VisualStudio.TestTools.UITesting
  BasicMessage=The playback failed to find the control with the given search properties.
  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, 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.Find()
       at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
       at Microsoft.VisualStudio.TestTools.UITesting.SilverlightControls.SilverlightEdit.get_IsPassword()
       at Microsoft.VisualStudio.TestTools.UITesting.SilverlightControls.SilverlightEdit.set_Text(String value)
       at SmokeTest.UIMap.WillThisWork() in c:\Users\cwhite76\Documents\Visual Studio 2012\Projects\TestRad\SmokeTest\UIMap.Designer.cs:line 46
       at SmokeTest.CodedUITest1.CodedUITestMethod1() in c:\Users\cwhite76\Documents\Visual Studio 2012\Projects\TestRad\SmokeTest\CodedUITest1.cs:line 29
  InnerException: System.Runtime.InteropServices.COMException
       HResult=-2147467259
       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, Boolean resetSkipStep)
            at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
            at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth)
            at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
       InnerException: 


And here is the XAML file I used.

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="TestRad.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="20">
            </RowDefinition>
            <RowDefinition>
            </RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="1" Width="auto" Height="auto">Welcome to the Test Application</TextBlock>
        
        <telerik:RadTabControl Grid.Row="1" Grid.Column="1" TabNavigation="Once">
            <telerik:RadTabItem x:Name="RadTabItem" Header="RadTabItem" TabNavigation="Once">
                <Grid Background="Transparent">
                    <TextBox Name="TestMe" Height="20" Width="100" />
                </Grid>
            </telerik:RadTabItem>
        </telerik:RadTabControl>
    </Grid>
</UserControl>

Many Thanks

Chris White

2 Answers, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 12 Nov 2012, 08:01 AM
Hello Cameron Molyneux,

Thank you for this report. We are aware of this issue and it is logged in our bug tracking system here, where you can track its progress and vote for it.

Unfortunately, currently there is no workaround for it, but we decided to increase its priority and will try to fix/workaround it soon. We will let you know once the fix is ready (hopefully in few weeks).

All the best,
Vladislav
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Vladislav
Telerik team
answered on 05 Dec 2012, 09:50 AM
Hi Cameron,

We want to inform you, that we managed to fix this issue and the fix is available in latest official 2012 Q3 SP release and in the latest internal builds.
If possible, can you try your project/s with some latest release in order to check if this fix fits your requirements/expectations.

Thank you in advance.

Regards,
Vladislav
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TabControl
Asked by
Cameron Molyneux
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Share this question
or