Telerik Forums
UI for WPF Forum
2 answers
216 views

Hi,

I am new to using Telerik Framework. I am trying to write automated tests for a WPF application that we have, but I keep getting a null reference exception when I try and use the code described in this page http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/wpf-ui-automation. 

 

This happens in the line that is launching the application 'WpfApplication foo = myManager.LaunchNewApplication(@"C:\Users\e-ddcr\Documents\GAV\2.0\gav-app\PokeMoon\PokeMoon.Startup\bin\Debug\PokeMoon.Startup.exe"); '. Unfortunately the error does not seem to give me very much to go on, and I could not find anything online that helped resolve the issue. 

Below you have the details of the error and my code. Any help would be hugely appreciated.

 

Many thanks,

 

Error:

Test Name: Open_Application
Test FullName: UnitTestProject2.TelerikNUnitTest1.Open_Application
Test Source: C:\Users\e-ddcr\Documents\GAV\2.0\gav-app\PokeMoon\UnitTestProject2\TelerikNUnitTest1.cs : line 37
Test Outcome: Failed
Test Duration: 0:00:10,4944389

Result StackTrace:
at ArtOfTest.Common.Win32.Connector.InjectCode(IntPtr handle, String assemblyAndClass, String pipename, String pid, Boolean waitForDocument, Int32 waitForDocumentTimeout)
   at ArtOfTest.WebAii.Wpf.WpfWindow.ConnectToWindow(IntPtr handle, String pipename, String pid)
   at ArtOfTest.WebAii.Wpf.WpfApplication.get_MainWindow()
   at ArtOfTest.WebAii.Core.Manager.LaunchNewApplication(ProcessStartInfo pinfo)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewApplication(String path, String[] args)
   at UnitTestProject2.TelerikNUnitTest1.Open_Application() in C:\Users\e-ddcr\Documents\GAV\2.0\gav-app\PokeMoon\UnitTestProject2\TelerikNUnitTest1.cs:line 48
Result Message:
Test method UnitTestProject2.TelerikNUnitTest1.Open_Application threw exception: 
System.NullReferenceException: Object reference not set to an instance of an object.

 

Code:

using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Wpf;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject2
{
    /// <summary>
    /// Summary description for TelerikNUnitTest1
    /// </summary>
    [TestClass]
    public class TelerikNUnitTest1 : BaseWpfTest
    {

        private TestContext testContextInstance;

        public WpfApplication foo { get; private set; }

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>

        [TestMethod]
        public void Open_Application()
        {
            // Create my own Settings object and then modify the defaults
            Settings mySettings = new Settings();
            mySettings.ClientReadyTimeout = 60000;

            // Use my Settings object to construct my Manager object
            Manager myManager = new Manager(mySettings);

            // Launch the application instance from its location in file system
            WpfApplication foo = myManager.LaunchNewApplication(@"C:\Users\e-ddcr\Documents\GAV\2.0\gav-app\PokeMoon\PokeMoon.Startup\bin\Debug\PokeMoon.Startup.exe"); 

            //// Validate the title of the homepage
            //ArtOfTest.Common.UnitTesting.Assert.IsTrue(foo.MainWindow.Window.Caption.Equals("MainWindow"));
         
            Button np = foo.MainWindow.Find.ByName<Button>("New project...");
            np.User.Click();
        }
        
    }
}

 

David
Top achievements
Rank 1
 answered on 16 Sep 2016
7 answers
184 views

It looks like the RadPropertyGrid doesn't supply an ITypeDescriptorContext when invoking TypeConverters on a property (the context is alwayas null). This makes it impossible to use custom type converters that do things like provide custom standard values. Is this a known limitation, are there plans to add support for this?

 

Thanks

Stefan
Telerik team
 answered on 16 Sep 2016
3 answers
175 views

I've used your tutorial "Templating the GroupHeaders topic" to create a custom GroupHeaderContentTemplateSelector.

How do I make each group header height to stretch to the content of the header template? For example the first group header height is 200px, the second 300px, the third 80px. Currently all group headers have equal height. Is this possible?

 

Kalin
Telerik team
 answered on 16 Sep 2016
1 answer
64 views

Hi,

I am using Rad Timebar for showing charts. In that I added 6 intervals year,quarter,month,week,day,hour scrolling upto month level only. When I remove month interval it is scrolling Quarter level. I would like to scroll both month as well as quarter, means after month scrolling need to show quarter level on the top of the head.

 

 

Regards,

Swamy.

                   

Martin Ivanov
Telerik team
 answered on 15 Sep 2016
3 answers
87 views

I have a CollectionEditor called Pictures which has key value pairs as items. The value is a path to an image file. My template for CollectionEditor looks like this:

<Style TargetType="telerik:CollectionEditor">
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Bit}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

I would like to add a browse button to the 'content' field. Is that possible?

Stefan Nenchev
Telerik team
 answered on 15 Sep 2016
2 answers
280 views

Hi, it's possibile not delete the appointment then the user press the key Delete ?

I have the ShowAppointmentDeleteButton="False" and the user delete the appointment usign the contexmenu, but if press the key Delete, the appointment is delete from the scheduler but obviously not from database.

 

I have using the event PreviewKeyUp, but not work.

 

if you have any solution...thanks

 

Aurelio

 

Aurelio Righetti
Top achievements
Rank 1
 answered on 15 Sep 2016
12 answers
709 views
H,
I try to add richTextBox to the window and I get this Error:
"The Component Telerik.windows.Documents.UI.Adorner.ImageAdornerUI does not have a resource identified by the uri 
Telerik.windows.Documents;component /UI/Adorner/ImageAdornerUI .xaml"
Thanks. 
Tanya
Telerik team
 answered on 15 Sep 2016
11 answers
161 views
Hello,

we evaluate to replace the current 2D chart library in our application with  Telerik's and have the following requirements:

Supported Chart Types:
- Line-Chart
- Spline-Chart
- Bar-Chart
- Point-Chart
- Step-Chart
Legend Support
Cross hair cursor support
Data Point cursor support
Multiple Y-Axis which:
- should be moveable ( left <-> right )
- should have configureable minimum and maximum
- should support multiline configureable title
- should support scientific tick labels
- should support configureable major and minor grid lines
Multiple Data-Series which:
- should support configureable series color
- should support configureable series point marker (should be visible in Plot and Legend)
- should support configureable series stroke type and thickness

Does RadChart and/or RadChartView meet this requirements and which of the control(s) do you recommend?

best regards,
Stefan
Stefan
Top achievements
Rank 1
 answered on 15 Sep 2016
5 answers
575 views

Hi,

  The Collection Editor is part of RadPropertyGrid defined below:
   

<telerik:RadPropertyGrid x:Name="grdTestProperty"
                         Item="{Binding TestProperty, Mode=OneWay}"
                         SearchBoxVisibility="Collapsed"
                         SearchInNestedProperties="False"
                         FieldIndicatorVisibility="Collapsed"
                         IsVirtualizing="False"
                         AutoGeneratePropertyDefinitions="True"
                         NestedPropertiesVisibility="Visible"
                         LabelColumnWidth="150"                                 
                         RenderMode="Hierarchical"
                         IsReadOnly="{Binding IsReadOnly, Mode=OneWay}"/>

   Please see attached picture showing the desired output.

 

Joel
Top achievements
Rank 1
Iron
 answered on 15 Sep 2016
2 answers
206 views

When I select a row in a RadGridView (as shown below)

    private void gridviewServiceTraceWatchList_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {

            txtBillTo.Text = e.AddedItems[0].ToString();

        }


I get: “ServiceTrace.WPFApplication.CIPService.ServiceTraceWatchListData”

I’ve tried everything I know and looked and nothing works. Can anyone tell me what I’m missing? It has to be simple and I'm overthinking it. I just want to get a single field item from a row of data.

 

Thanks in advance.

 

J

Customer Care Systems
Top achievements
Rank 2
 answered on 14 Sep 2016
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?