Telerik Forums
Testing Framework Forum
1 answer
96 views
I'm trying to make so that tests were run at startup AzureVM. 
But the tests are not always pass. What could be the reason? May need to specify the size of the screen?
Ivaylo
Telerik team
 answered on 02 Oct 2014
1 answer
79 views
Hi,

I am new to Coded UI and Telerik controls and having some issues with building coded UI tests on a Telerik based application. The AUT is developed using Telerik WPF (or Winforms not actually sure) and when I record the actions, each edit control is recorded under a separate window. Also, for each of the windows and edit boxes there are no search properties recorded. Though the test seems to work when I run it, it would be a maintenance issue if UIMAP does not have controls with unique properties.I have followed instructions provided in "http://www.telerik.com/help/wpf/coded-ui-support.html". 

Do I go back to the developers and ask them to define the control names or am I missing something ?
George
Telerik team
 answered on 01 Oct 2014
10 answers
117 views
Hi,

I am using Find Strategy in the manner described in http://www.telerik.com/forums/how-to-judge-whether-the-element-exists

However, in a repeated set of runs, sometimes line 175 below fails with the traceback below. Sometimes this exception occurs
in run 10, sometimes in run 6 etc.


         >         public void SanitizedFunction()
         >         {
         >
         >             FindStrategy originalStrategy = wpfClient.MainWindow.Find.Strategy;
         >             wpfClient.MainWindow.Find.Strategy = FindStrategy.WhenNotVisibleReturnNull;
         >             try
         >             {
         >                 wpfClient.MainWindow.Window.SetFocus();
         >                 wpfClient.MainWindow.RefreshVisualTrees();
line 175 >                 var dvGrid = wpfClient.MainWindow.Find.ByAutomationId("RadGridView"); // telerik control with AutomationId added
         >                 if(dvGrid!=null)
         >                 {
         >                    // real work here ...
         >                 }
         >                 else
         >                 {
         >                     Assert.IsTrue(dvGrid!=null,"dvGrid should not be null");
         >                 }
         >             }
         >             finally
         >             {
         >                wpfClient.MainWindow.Find.Strategy = originalStrategy;                
         >             }
         >         }
         >

         The traceback :
         >    at ArtOfTest.WebAii.Wpf.WpfProxy.ExecuteSLCommand(SilverlightCommand cmd)
         >    at ArtOfTest.WebAii.Wpf.WpfProxy.GetVisibility(IAutomationPeer peer)
         >    at ArtOfTest.WebAii.Silverlight.FrameworkElement.get_Visibility()
         >    at ArtOfTest.WebAii.Silverlight.FrameworkElement.get_IsVisible()
         >    at Telerik.XamlAutomation.SteelThread.TelerikSteelThread.SanitizedFunction() in TelerikSteelThread.cs: line 175
         >    at Telerik.XamlAutomation.SteelThread.TelerikSteelThread.Execute(IEnumerable`1 funcs) in TelerikSteelThread.cs: line 268
         >    at Telerik.XamlAutomation.SteelThread.TelerikSteelThread.OneRunNotamSteelThread() in TelerikSteelThread.cs: line 402
         >    at Telerik.XamlAutomation.SteelThread.TelerikSteelThread.<TestLoop>b__3(Int32 i) in TelerikSteelThread.cs: line 427
         >    at Jeppesen.MarineOperations.DotnetUtils.LinqUtils.ForEach(IEnumerable`1 enumeration, Action`1 action) in LinqUtils.cs: line 21
         >    at Telerik.XamlAutomation.SteelThread.TelerikSteelThread.TestLoop() in TelerikSteelThread.cs: line 424
         >

The traceback seems to say that FindByAutomationId fails because dvGrid is not visible, right in the Find itself, so the check
for dvGrid==null is too late, ocassionally.

Any ideas why this is so?
Cody
Telerik team
 answered on 26 Sep 2014
4 answers
282 views
Hello! 

Trying to click on a list object inside of an iFrame. No errors are thrown but the click action never seems to occur!

ArtOfTest.WebAii.Core.Browser iFrame = man.ActiveBrowser.Frames[0];

Element listBox = iFrame.Find.ById("ListBox1");
Element bradtest = TelerikHelper.FindNestedElementByLoc(listBox, ("1"));

iFrame.Actions.Click(bradtest);


Does this look correct?  TelerikHelper.findNestedElement is a helper function I wrote. It simply finds children elements and is proven to work. I checked to make sure "bradtest" is the correct element I'm attempting to click and it is. 


Boyan Boev
Telerik team
 answered on 26 Sep 2014
1 answer
110 views
I started to use Testing Framework, and  my console application runs just fine, but any other desktop or WPF have similar results:
Chrome and Firefoks stucks at "Preparing browser for automation..." message, InternetExplorer throws window saying something similar to
"Cant find module ArtOfTest.Connector.dll" and timeout later.
I am using Visual Studio 2013 run as administrator, Windows Server 2012 and reinstalled fresh version of Test Framework.
Boyan Boev
Telerik team
 answered on 23 Sep 2014
7 answers
268 views

Hi,

Environment
   - TTF: 2014.3
   - Visual Studio 2012

I am finding that I am not seeing the WindowClosed event handler getting called.
I even set things up so that I manually open and close the window; the event handler
does not seem to be fired.

I'm assuming that TTF does not require any special work to be done by the Wpf client
in order to see the event, right?

Hopefully, someone has some ideas and suggestions.

Thanks in advance,

Below is a sample code :

public class TestClass {
     private bool _winClosed;
     private void WindowClosedEventHandler(object sender, EventArgs e)
     {
         _winClosed = true;
     }
 
     public void CloseWindow()
     {
         var win = wpfClient.WaitForWindow("Header of Window", _settings.ExecuteCommandTimeout);
         win.WindowClosed += WindowClosedEventHandler; // subscribe to event
         _winClosed = false;
         win.Window.SetFocus();
 
         while(!_winClosed) // wait for event handler to set _winClosed to true
         {
             Logger.Debug("Waiting for win to close");
             Pause(500);
         }
         win.WindowClosed -= WindowClosedEventHandler; // unsubscribe to event
     }
     ...
}

Cody
Telerik team
 answered on 18 Sep 2014
10 answers
353 views
It appears that the testing framework is automating a browser that is installed on the system. For example, if I try to launch a Chrome browser, but Chrome is not installed, I get an error.

Is there an in-memory browser of any kind? I don't care if it's IE, Chrome, FireFox, or something else. I don't want to rely on a "properly" configured browser installed on the machine in order for things to work. I am also concerned about cookie sharing among concurrent browser windows (the default for IE 8 & 9).

I am aware that these issues can be addressed using specific browser configurations and registry hacks, but again, I don't really want to have to rely on browser configuration settings for things to work properly.

I'm looking for something akin to what HtmlUnit provides for the Java community, but I absolutely love the Test Studio interface for creating tests.

Thanks!
Scott
Cody
Telerik team
 answered on 17 Sep 2014
9 answers
580 views
HI,

I am currently writing a test case to open the browser and select a database in the application. When I run the test first time it put the vale in the textboxes and then select the database.

But runnig the test second time the value selected in previous run is there and my test fails. Is there a way where the test is run every time from the start irrespective what has been run previously. I guess there should be some way to cleanup the test which is ran previosly. 

Thanks
Amar
//Use ClassInitialize to run code before running the first test in the class
      [ClassInitialize()]
      public static void MyClassInitialize(TestContext testContext)
      {
      }
 
      /// <summary>
      /// Use TestInitialize to run code before running each test
      /// Initializes WebAii manager to be used by the test case.
      /// If a WebAii configuration section exists, settings will be
      /// loaded from path. Otherwise, will create a default settings
      /// object with system defaults.
      ///
      /// Note: We are passing in a delegate to the VisualStudio
      /// testContext.WriteLine() method in addition to the Visual Studio
      /// TestLogs directory as our log location. This way any logging
      /// done from WebAii (i.e. Manager.Log.WriteLine()) is
      /// automatically logged to the VisualStudio test log and
      /// the WebAii log file is placed in the same location as VS logs.
      ///
      /// If you do not care about unifying the log, then you can simply
      /// initialize the test by calling Initialize() with path parameters;
      /// that will cause the log location to be picked up from the config
      /// file if path exists or will use the default system settings (C:\WebAiiLog\)
      /// You can also use Initialize(LogLocation) to set a specific log
      /// location for this test.
      /// </summary>
      [TestInitialize()]
      public void MyTestInitialize()
      {
          #region WebAii Initialization
 
           
 
          // Pass in 'true' to recycle the browser between test methods
          Initialize(false, this.TestContext.TestLogsDir, new TestContextWriteLine(this.TestContext.WriteLine));
 
          // Set the current test method. This is needed for WebAii to discover
          // its custom TestAttributes set on methods and classes.
          // This method should always exist in [TestInitialize()] method.
           SetTestMethod(this, (string)TestContext.Properties["TestName"]);
 
          _telerikBrowser = new TelerikBrowser();
          _app = _telerikBrowser.App;
          _telerikButton = new TelerikButton(_app);
          _telerikTextBox = new TelerikTextBox(_app);
          _telerikTextBlock = new TelerikTextBlock(_app);
          #endregion
 
          //
          // Place any additional initialization here
          //
 
 
      }
 
      // Use TestCleanup to run code after each test has run
      [TestCleanup()]
      public void MyTestCleanup()
      {
 
          //
          // Place any additional cleanup here
          //
 
          #region WebAii CleanUp
 
          // Shuts down WebAii manager and closes all browsers currently running
          // after each test. This call is ignored if recycleBrowser is set
          this.CleanUp();
 
          #endregion
      }
 
      //Use ClassCleanup to run code after all tests in a class have run
      [ClassCleanup()]
      public static void MyClassCleanup()
      {
          // This will shut down all browsers if
          // recycleBrowser is turned on. Else
          // will do nothing.
 
          ShutDown();
      }
 
      #endregion
 
      /// <summary>
      /// Method to add the different values for selecting the PDB by selexting different control in TelerikCommon
      /// </summary>
      [TestMethod]
      public void AddNewPdbSelector_ValidPDB_MethodSuccessful()
      {
          String PDB = "Athene1_DB";          
           System.Threading.Thread.Sleep(4000);
           
          //click the plussy plus sign
          _telerikButton.ClickButton(ControlsDefinition.PdbAddButton);
 
          //refresh
          _app.RefreshVisualTrees();
          //populate controls
          _telerikTextBox.PutValueToTextBox(ControlsDefinition.PdbHostNameAssociatedLabelText, "AB-M4500", true);
          _telerikTextBox.PutValueToTextBox(ControlsDefinition.PdbInstanceNameAssociatedLabelText, " ", true);
          _telerikTextBox.PutValueToTextBox(ControlsDefinition.PdbInstancePortAssociatedLabelText, "0", true);
          _telerikTextBox.PutValueToTextBox(ControlsDefinition.PdbNameAssociatedLabelText, "Athene1_DB", true);
          // log a message
 
          //click the button
          _telerikButton.ClickButton(ControlsDefinition.PdbCommitButton, 4000);
 
          //refresh
          _app.RefreshVisualTrees();         
 
 
      }
?
Boyan Boev
Telerik team
 answered on 16 Sep 2014
3 answers
201 views
Is there any current support for Html Input Type "tel"?  In terms of accessing and invoking javascript on an element of type HtmlInputTel which Control should I attempt to use, or will 'InputTel's be not accessible?   Example of Html Code below:

<div id="rowPhone" class="formRow" style="">
    <label class="inlineBlock inputLabel" for="myAccount_phone">Primary Phone:(/label>
    <input id="myAccount_phone" class="inlineBlock error" type="tel" aria-describedby="errorContainer_phone" data-bind="value: Phone" name="phone" aria-invalid="true">
    <div id="ui-id-24" class="error fieldErrorContainer" aria-atomic="true" role="alert" style="width: 140px; text-align: left; position: relative; top: 0px; left: 103.85px; height: auto;"></div>

Is this something that is in the works for future Telerik development?  Thanks
Boyan Boev
Telerik team
 answered on 16 Sep 2014
2 answers
74 views
Hi,

I am trying to identify a href link which doesnt contain any unique property,i have used  htmlhyperlink,htmlcontrol but i am unable do so.

Kindly help me out ASAP

Thanks
Nalin
Boyan Boev
Telerik team
 answered on 16 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?