Telerik Forums
UI for WPF Forum
4 answers
436 views

Hi Team,

I am working on a WPF application which extensively uses Telerik controls.We are trying to automate few scenarios in our application. As a beginner in Coded UI I started by recording a simple flow, however while replaying the same ,faced couple of issues highlighted below

Note: We are using  Telerik version -2014.3.1202.40

Script not identifying ControlType-:TabPage,this control is located inside rbrMain.
Refer attachment –screenshot 1 & 2. Find Below the error message I receive:
Test Name:         CodedUITestMethod1
Test FullName:   CodedUITestProject_IncentBasic.CodedUITest1.CodedUITestMethod1
Test Source:        <<Project code>> failed at
Test Outcome:   Failed
Test Duration:    0:00:34.7996513
Result Message:              
Test method CodedUITestProject_IncentBasic.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:  'MSAA'
ControlType:  'TabPage'
Name:  'Data'
 ---> 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.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__37()
   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__DisplayClass3b.<GetProperty>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.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)



When trying to click on buttons located on RBR main and not on TabPage control script is still not identifying those objects and failing on replay:
Refer Screenshot 3  in attachment .
Find below the error message.


Result Message:              
Test method Incent_Scenario2_ClickOnReportButton.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:  'MSAA'
ControlType:  'Button'
Name:  'Reports'

 ---> 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.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__37()
   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__DisplayClass3b.<GetProperty>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.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)



Peshito
Telerik team
 answered on 24 Dec 2015
1 answer
240 views
I would like to attach a Code128 barcode on the corner of a existing image ( jpeg, png, tiff) programmatically, and then print it out through program. But so far as I go through the telerik document and demo, I couldn't find a proper way to put the barcode on the image. Is there any way to do so ? I would really appreciate if anyone would give me any suggestion.
Martin Ivanov
Telerik team
 answered on 23 Dec 2015
1 answer
197 views

Can anybody help with why the following will not display a vertical

<Grid>
        <telerik:RadListBox HorizontalAlignment="Left" Height="135" Margin="24,13,0,0" VerticalAlignment="Top" Width="510" ItemsSource="{Binding Source={StaticResource groups}, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding AssocIdx, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
            <telerik:RadListBox.ItemTemplate>
                <DataTemplate>
                    <VirtualizingStackPanel>
                        <TextBlock Text="{Binding display}" />
                    </VirtualizingStackPanel>
                </DataTemplate>
            </telerik:RadListBox.ItemTemplate>
            <telerik:RadListBox.GroupStyle>
                <GroupStyle HeaderTemplate="{StaticResource groupTemplate}" />
            </telerik:RadListBox.GroupStyle>
        </telerik:RadListBox>
</Grid>

but the following does?

<Grid>
        <telerik:RadListBox Height="77" Width="410" ItemsSource="{Binding Source={StaticResource groups}}" SelectedIndex="{Binding AssocIdx, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
            <telerik:RadListBox.ItemTemplate>
                <DataTemplate>
                    <VirtualizingStackPanel>
                        <TextBlock Text="{Binding Name}" />
                    </VirtualizingStackPanel>
                </DataTemplate>
            </telerik:RadListBox.ItemTemplate>
             
            <telerik:RadListBox.GroupStyle>
                <GroupStyle HeaderTemplate="{StaticResource groupTemplate}" />
            </telerik:RadListBox.GroupStyle>
             
        </telerik:RadListBox>
    </Grid>

Polya
Telerik team
 answered on 23 Dec 2015
1 answer
161 views

I recently wanted to add "headers" to my ListBox and was able to do so thanks to the following post:

http://www.telerik.com/forums/can-a-listbox-have-headers

However, now I haven't been able to have the entries in the listbox refresh when the underlying data changes. It seemed to work just find before the "headers" were added. I have attached the original code when the data binding seemed to work fine:

<telerik:RadListBox HorizontalAlignment="Left" Height="235" Margin="24,13,0,0" VerticalAlignment="Top" Width="510" ItemsSource="{Binding Associates, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding AssocIdx, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" DisplayMemberPath="display">
        </telerik:RadListBox>

and the code where the headers works fine (but data binding doesn't seem to work when the data changes...):

<telerik:RadListBox HorizontalAlignment="Left" Height="235" Margin="24,13,0,0" VerticalAlignment="Top" Width="510" ItemsSource="{Binding Source={StaticResource groups}, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding AssocIdx, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" DisplayMemberPath="">
            <telerik:RadListBox.ItemTemplate>
                <DataTemplate>
                    <VirtualizingStackPanel>
                        <TextBlock Text="{Binding display}" />
                    </VirtualizingStackPanel>
                </DataTemplate>
            </telerik:RadListBox.ItemTemplate>
            <telerik:RadListBox.GroupStyle>
                <GroupStyle HeaderTemplate="{StaticResource groupTemplate}" />
            </telerik:RadListBox.GroupStyle>
        </telerik:RadListBox>

Polya
Telerik team
 answered on 23 Dec 2015
3 answers
159 views

Hi all,

  I implement row drag drop function, I got a demo source code in somewhere forum(), the problem is:

In demo source code, Telerik tersion is 2009.1.526.35, below code works OK

private void RowMouseMove(object sender, MouseEventArgs e)
{
//Some code
RadItemsControl itemsControl = this.gridView.ItemsControl;
this.currentDropIndex = itemsControl.Records.IndexOf(row.Record);
//Some code
}

But currently my solution uses a newer Telerik version, 2014.1.331.40, RadItemsControl could not be found. 

How can I find the similar control to replace the old one? Or any idea to get current drop index here?

 Thanks.

 

Quang Khải
Top achievements
Rank 1
 answered on 23 Dec 2015
3 answers
97 views
I'm using the RadDesktopAlert to display notifications in my WPF app. When I open a RadWindow while a RadDesktopAlert is being displayed, the RadWindow disappears when the RadDesktopAlert disappears. I don't think the RadWindow is being closed or minimized, as neither of the associated events are fired when the RadWindow disappears. Is this possibly a bug in the RadDesktopAlert?
Kalin
Telerik team
 answered on 23 Dec 2015
0 answers
317 views

I'm using a simple RadMenu and I am having a bit of trouble getting it to look correctly in the application.

It seems to be adding a small padding area to the surrounding the first menu item. (I've attached an image of how it renders in the application)

Here is the XAML: 

<DockPanel Height="40" >
    <telerik:RadMenu Height="40" Width="100" HorizontalAlignment="Right" VerticalAlignment="Center" FlowDirection="RightToLeft" IconColumnWidth="0" Padding="0" Margin="0">
        <telerik:RadMenuItem Width="100" Header="Menu" Click="RadMenuItem_Click" HorizontalAlignment="Right" Margin="0,0,-2,0" Height="40" >
            <telerik:RadMenuItem Header="Main" Height="40"/>
            <telerik:RadMenuItem Header="Alarms" Height="40"/>
            <telerik:RadMenuItem Header="Configuration" Height="40"/>
            <telerik:RadMenuItem Header="Exit" Height="40"/>
        </telerik:RadMenuItem>
    </telerik:RadMenu>
</DockPanel>

Also, I don't want the arrow icon to appear, but I don't seem to be able to get rid of it.

I'm using the Windows8Touch theme.

Any help would be appreciated.

 

paully21
Top achievements
Rank 1
 asked on 22 Dec 2015
2 answers
496 views

I'm looking for a way to change the background of the title bar of a RadWindow.Alert.

I'm looking to mimic the affect that line one has on the title bar without changing the accent color for ALL items.

Ideally, I'd like to be able to pass in the Colors.Red or set a Style Resource somewhere.

 

01.Windows8TouchPalette.Palette.AccentColor = Colors.Red;
02.RadWindow.Alert(new DialogParameters()
03.{
04.    Theme = new Windows8TouchTheme(),
05.    Content = GetAlarmDialogContent(),
06.    Closed = OnAlarmDialogClosed,
07.    OkButtonContent = "Acknowledge",
08.    Owner = this
09.});
 

 

paully21
Top achievements
Rank 1
 answered on 22 Dec 2015
3 answers
658 views
Hi,

it is posible to use RadListbox to reorder items by drag&drop whihe wrappanel is set as ItemsPanel?

<telerik:RadListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <telerik:RadListBox.ItemContainerStyle>
      <Style TargetType="telerik:RadListBoxItem" BasedOn="{StaticResource RadListBoxItemStyle}">
        <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
      </Style>
    </telerik:RadListBox.ItemContainerStyle>
     
    <telerik:RadListBox.DragVisualProvider>
      <telerik:ScreenshotDragVisualProvider />
    </telerik:RadListBox.DragVisualProvider>
     
    <telerik:RadListBox.DragDropBehavior>
      <telerik:ListBoxDragDropBehavior AllowReorder="True"  />
    </telerik:RadListBox.DragDropBehavior>
 
    <telerik:RadListBox.ItemsPanel>
      <ItemsPanelTemplate>
        <WrapPanel />
      </ItemsPanelTemplate>
    </telerik:RadListBox.ItemsPanel>
Polya
Telerik team
 answered on 22 Dec 2015
2 answers
168 views

Hi,

I am using ScatterSplineSeries and I have defined tooltip template in PointTemplate. My requirement is such that I do not want to see the data points visually but on mouse hover on point tooltip to be shown. Here is my XAML. I tried setting the Visibility property of the Ellipse but then tooltip also stopped showing. How to acheive this ? Please help me.

<telerik:ScatterSeriesDescriptor ItemsSourcePath="Points" YValuePath="YValue" XValuePath="XValue">
                    <telerik:ScatterSeriesDescriptor.Style>
                        <Style TargetType="telerik:ScatterSplineSeries">
                            <Setter Property="StrokeThickness" Value="{Binding StrokeThickness}"></Setter>
                            <Setter Property="Stroke" Value="{Binding Color}"></Setter>
                            <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BooleanToVisibilityConverter}}"></Setter>
                            <Setter Property="DisplayName" Value="{Binding Name}"></Setter>
                            <Setter Property="PointTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <Ellipse Width="10" Height="10"  Fill="{DynamicResource BRUSH_SELECTION}">
                                            <Ellipse.ToolTip>
                                                <ToolTip>
                                                    <ToolTip.Style>
                                                        <Style TargetType="ToolTip">
                                                            <Style.Setters>
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate>
                                                                            <Grid Background="{DynamicResource BRUSH_TOOLTIP}" HorizontalAlignment="Right" Width="120" Height="70">
                                                                                <StackPanel Margin="5" Orientation="Vertical">
                                                                                    <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                                                        <TextBlock Text="Volume: " FontWeight="Bold"/>
                                                                                        <TextBlock Text="{Binding XValue}" FontWeight="Bold"/>
                                                                                        <TextBlock Text=" %" FontWeight="Bold"/>
                                                                                    </StackPanel>
                                                                                    <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                                                        <TextBlock Text="Dose: " FontWeight="Bold" />
                                                                                        <TextBlock Text="{Binding YValue}" FontWeight="Bold" />
                                                                                        <TextBlock Text=" Gy" FontWeight="Bold"/>
                                                                                    </StackPanel>
                                                                                </StackPanel>
                                                                            </Grid>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
 
                                                            </Style.Setters>
                                                        </Style>
                                                    </ToolTip.Style>
                                                </ToolTip>
                                            </Ellipse.ToolTip>
                                        </Ellipse>
 
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
 
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsDashed,Mode=TwoWay}" Value="True">
                                    <Setter Property="DashArray" Value="5"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:ScatterSeriesDescriptor.Style>
                </telerik:ScatterSeriesDescriptor >

Shilpa
Top achievements
Rank 1
 answered on 22 Dec 2015
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?