Telerik Forums
Testing Framework Forum
1 answer
179 views
I've been using the built in facility in Visual studio 2010 for creating unit tests in Silverlight. 
(Microsoft.Silverlight.Testing.dll and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll)

I now want to use Telerik Testing Framework for scipted UK testing

I've installed TTF

Various libraries are installed in C:\Program Files\Telerik\Test Studio\Bin\  but only 
artoftest.SL.Extension and 
Telerik.WebAii.Controls.Xaml.CustomTypes
can be added to my project, as they seem to be the only ones compiled in the Silverlight Library

So how to get started?

I can't follow your youtube example by Jim Holmes as that's not for Silverlight.

The first reference I can find to Silverlight in the documentation is at http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/silverlight-ui-automation
However this only lists a method, and excludes the class, namespace and "using" statements.

It starts:
        [TestMethod]
        public void SLDemo()
        {
            //Enable Silverlight
            Settings.Current.Web.EnableSilverlight = true;


and it fails on Settings as there is no context for it.

(

I put this as a basic header for it:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ViewsTests
{
    [TestClass]
    public class TelerikVSUnitTest1 

)    

Another alternative I tried was to use the templates.  Using Test > TelerikTestingFramework>Web>VsUnit  gives me a template which includes the following:

using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.TestAttributes;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Win32.Dialogs;
 
none of which compile.

Could you point me in the right direction to make some progress.

Many thanks.



James
Top achievements
Rank 1
 answered on 04 Sep 2015
3 answers
200 views
Hi,
I am interested in next topic:
- Can I use Telerik Test Framework for desktop automation for windows form based applications ?

For example simple test:
I'd like to launch calc.exe, then press couple buttons, then verify result.

If that possibly to do ? Or only Silverlight / WPF supported in desktop direction?
Cody
Telerik team
 answered on 31 Aug 2015
1 answer
125 views

OK, absolute noob with Testing Framework. First thing I'm trying to do is find a checkbox control on our WPF UI:

System.Diagnostics.Process.Start("OurApplication.exe");
System.Diagnostics.Process[] appProcess = proc.GetProcessesByName("OurAppHost");
WpfApplication wpfApp = Manager.ConnectToApplication(appProcess[0]);
CheckBox chkClientExists;
chkClientExists = wpfApp.MainWindow.Find.ByAutomationId<CheckBox>"Existing_Client_Checkbox");

Running in debug mode, that last line fails with "Wait for condition has timed out" error. Looks like:

System.TimeoutException was unhandled
  HResult=-2146233083
  Message=Wait for condition has timed out
  Source=ArtOfTest.WebAii
  StackTrace:
       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
       at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
       at ArtOfTest.WebAii.Silverlight.VisualWait.ForExistsInternal(Int32 timeout, Boolean invertCondition)
       at ArtOfTest.WebAii.Silverlight.VisualWait.ForExists(Int32 timeout)
       at ArtOfTest.WebAii.Silverlight.VisualWait.ForVisible(Int32 timeout)
       at ArtOfTest.WebAii.Silverlight.VisualFind.ReturnOrThrow(FrameworkElement e, String throwMessage)
       at ArtOfTest.WebAii.Silverlight.VisualFind.ByAutomationId(String id, String xamlTag)
       at ArtOfTest.WebAii.Silverlight.VisualFind.ByAutomationId[T](String id)
  InnerException:

But if then, while execution is suspended, I copy and paste that line into the Immediate window and execute it there, it returns the checkbox instantly and I'm able to examine all its properties and its children in Locals and Watch.

I have no trouble locating this control in OOB Coded UI  by AutomationID, but it's a custom control and there are no properties visible to Coded UI by which we can determine its state. That seems to be determined by child elements (XAML Ellipses apparently) that Coded UI is unable to see. Testing Framework IS able to see them, IF I can get the parent, and I don't seem to be able to get the parent for some reason. At least not in executing code.

Help?

 ddk

Ivaylo
Telerik team
 answered on 28 Aug 2015
6 answers
209 views
Hi Team,

 I would like to ask few questions about Telerik Testing Framework for silverlight applications

   I need to  build a framework to automate the silverlight applications using telerik

Using Telerik Testing Framework :-

      1. Is Telerik Testing Framework supports automating silverlight applications or not ? If yes then can I convert into POM(Pageobject model) like as in selenium. I've already done the same for HTML applications to some extent .

      2. If Telerik Testing Framework supports silverlight applications  then how can i inspect the locators with out using telerik teststudio highlighting tool/element repository however, can't  able to inspect element from silverlight application web UI like as HTML application.

Building a framework for silverlight applications using telerik teststudio (standalone /Visual studio plugin):-

      1. Is this above approach is possible i e converting the teststudio in to a POM (Page Object Model) and locating the elements using highlighting (Add to element repository)

NOTE:-  Please provide me correct possibilities and limitations of the way of approaches I choose . Please let me know your opinion on which way the silverlight applications can be automated that can handle maintainable, reusable, report generation and easier process.

Thanks in advance please respond me ASAP

Regards,

Udaykumar
Boyan Boev
Telerik team
 answered on 26 Aug 2015
1 answer
105 views
Hi Team,

I'm trying to build a framework which follows PageObjectModel using Telerik Testing Framework for Silverlight application on Visual studio.

ELEMENT INSPECTING PROBLEM:

         I'm not able to inspect the element directly from UI of silverlight application as like in HTML application. so, to identify the locator in DOM I've used Telerik standalone Record and Playback approach so that by using Highlighting tool I'm able to View the DOM of silverlight.

          I've also recorded a step and edit the element through ElementRepository and found a path for a particular field i e like
 (XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1", "|", "XamlTag=TextBox)

 I've used the same path in TTF using XamlFindExpression   as below
app.Find.ByExpression(new XamlFindExpression("XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1", "|", "XamlTag=TextBox")).User.TypeText("telerik", 10);  //return null
but here it returns null however I tried with different paths by looking on to DOM at standalone and below one is working fyn
 app.Find.ByName("ContentElement").User.TypeText("telerik", 10);  //able to enter text

I don't know why it beheaves like this the path(locator) which works in standalone is not works in Telerik Testing Framework. Can you please explain me why it beheave like this and what way it was finding element.  
please let me know is there any thing that i need to import when finding elements with.ByExpression .
         

         Below attached is a sample test on silverlight application using TTF find the commented code which was the path stored in Standalone elementrepository.     


Regards,
Uday.
Ivaylo
Telerik team
 answered on 24 Aug 2015
1 answer
114 views
Hi Team,

I'm trying to build a framework which follows PageObjectModel using Telerik Testing Framework for Silverlight application on Visual studio.

ELEMENT INSPECTING PROBLEM:

         I'm not able to inspect the element directly from UI of silverlight application as like in HTML application. so, to identify the locator in DOM I've used Telerik standalone Record and Playback approach so that by using Highlighting tool I'm able to View the DOM of silverlight.

          I've also recorded a step and edit the element through ElementRepository and found a path for a particular field i e like
 (XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1", "|", "XamlTag=TextBox)

 I've used the same path in TTF using XamlFindExpression   as below
app.Find.ByExpression(new XamlFindExpression("XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1", "|", "XamlTag=TextBox")).User.TypeText("telerik", 10);  //return null
but here it returns null however I tried with different paths by looking on to DOM at standalone and below one is working fyn
 app.Find.ByName("ContentElement").User.TypeText("telerik", 10);  //able to enter text

I don't know why it beheaves like this the path(locator) which works in standalone is not works in Telerik Testing Framework. Can you please explain me why it beheave like this and what way it was finding element.  
please let me know is there any thing that i need to import when finding elements with.ByExpression .
         

         Below attached is a sample test on silverlight application using TTF find the commented code which was the path stored in Standalone elementrepository.     


Regards,
Uday.
Ivaylo
Telerik team
 answered on 24 Aug 2015
1 answer
92 views
Hi Team,

I would like to build a framework which follows Page Object Model using Telerik Testing Framework. We can easily Inspect the elements in HTML applications to locate the web element but in silverlight application it was unable to Inspect the element. Please provide me a solution to inspect  the locators for silverlight application  whether to use a third party tool or there is a way to identify through TTF . Thanks in advance


Regards,
K.Sreekanth Kumar. 
Ivaylo
Telerik team
 answered on 24 Aug 2015
1 answer
150 views
Hi Team,

I'm working on creating a Telerik Testing Framework for HTML/Silverlight applications using Nunit following are the issues I encountered

1. To achieve Page Object Model I had seperated TestSuites,Pagemethods,SafeActions and except Locators I'm not able to store the locators outside the testsuite file I'm getting the errors while doing this
    as 
    ERROR:  An object reference is required for the non-static field, method, or property 'ArtOfTest.WebAii.Core.Find.ById(string)' D:\Telerik\TTF_FRAMEWORK\TelerikFramework2\Pages\PageConstants\GmailConstants.cs 148 31 TelerikFramework2
     
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.TestAttributes;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Win32.Dialogs;

using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;

using NUnit.Framework;
using Core = NUnit.Core;
using TelerikFramework2;

namespace TelerikFramework2.Pages.PageConstants
{
   public  class Gmail : BaseTest
    {

     
     public static Element ID = Find.ById("Email");
     
     }
}


I understand "Find" class doesnot have any object reference since I'm not storing it in TestSuite ,I'm storing it in a class .cs file. Please provide me some suggestions so that I need to store all the locators seperatley and able access them from another class.Please Respond me ASAP ,Thanks in advance



Regard,
Uday. 

  
Ivaylo
Telerik team
 answered on 24 Aug 2015
3 answers
126 views

Hi,

 I have tried almost the whole weekend and unfortunately have no success: basically I only want to use the DialogMonitor to handle a simple SaveAs or Open dialog(both are Win32 dialog). I got always the System.TimeOutException after 60000 or after the time timeout specified with the WaitUntilHandled(2000), for example.

Here is the code I used:

    [TestMethod]
        public void Telerik()
        {
            TelerikCore.Settings mySettings = new TelerikCore.Settings();
            TelerikCore.Manager myManager = new TelerikCore.Manager(mySettings);
            myManager.Start();
 
            var wpf = System.Diagnostics.Process.GetProcesses().Where(p => p.ProcessName == "WpfApplication1");
 
            if (wpf.Count() != 0)
            {
                myManager.ConnectToApplication(wpf.FirstOrDefault());
            }
            else
            {
                myManager.LaunchNewApplication(@"D:\WpfApplication1.exe");
            }
 
            myManager.ActiveApplication.MainWindow.RefreshVisualTrees();
 
            ArtOfTest.WebAii.Win32.Dialogs.SaveAsDialog save = ArtOfTest.WebAii.Win32.Dialogs.SaveAsDialog.CreateSaveAsDialog(myManager.ActiveApplication,DialogButton.SAVE, @"C:\", "Save As");
 
            myManager.DialogMonitor.AddDialog(save);
            myManager.DialogMonitor.Start();
 
            var saveButton = myManager.ActiveApplication.MainWindow.Find.ByName("SaveButton");
            saveButton.User.Click();
 
            save.WaitUntilHandled();
        }

Please not that the application under test is a simple WPF application with two buttons: one for a SaveAs dialog and the other for a OpenFile dialog.

 Is there something wrong with the code?

 By the way, I 'm using the latest version of the Telerik Testing Framework.

 Great thanks for any tip in advance,

Thank you,

Bo

P.S. the WPF application is attached. Please rename it to an .exe file.

Ivaylo
Telerik team
 answered on 24 Aug 2015
2 answers
147 views

Hi,

 

is there a build-in handler for a ConfirmDialog of WPF? It seems that the ConfirmDialog(as well as the AlertDialog) in the namespace  ArtOfTest.WebAii.Win32.Dialogs only available for a browser.

 

By the way, I have tried the GenericDialog, but it did not work for me.

 

Best regards,

Bo

bo
Top achievements
Rank 1
 answered on 20 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?