Hi I am evaluating telerik Testing Framework to Automate my test. The page "http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/locating-elements" shows that one can use "Automation Id", "ByText" etc except ByName (Which doesn't work, it doesn't find the textbox).
Also i used "app.FindName<TextBox>("Password").Text = "xyz";" But this throws an error saying it cannot find the element.
Please let me know what I am missing.
I am trying to get the AutomationProperties.ItemStatus using the Telerik Test framework and it does not seem to exist anywhere. Is the only way around it to do the following? Surely there is a way directly from Telerik framework?
Get the handle from the Telerik framework and then use the System.Windows.Automation framework as follows...
var wpfHandle = customTelerikFrameworkElement.wpfWindow.Window.Handle
System.Windows.Automation.AutomationElement.FromHandle(this.wpfWindow.Window.Handle);
var root = System.Windows.AutomationAutomationElement.RootElement;
var image = root.FindFirst(TreeScope.Descendants, new System.Windows.Automation.PropertyCondition(System.Windows.Automation.AutomationElement.AutomationIdProperty, indicatorImage.AutomationId));
var props = image.GetSupportedProperties();
var prop = props.FirstOrDefault(p => p.ProgrammaticName == "AutomationElementIdentifiers.ItemStatusProperty");
var statusPropertyValue = image.GetCurrentPropertyValue(prop);
I believe there is a bug with the InputValue property. I have two kendo numeric text boxes, each with different values. However, when attempting to get the values they always return the value of the first box. I know the right ones are being selected because I can add attributes and get the correct attributes back. Just the InputValues return incocrrectly
var elements = myManager.ActiveBrowser.Find.AllByXPath("//div[@id='glazeWindow']//*[contains(@class,'k-widget')]");KendoInput txtOne = elements[0].As<KendoInput>();var q = txtOne.Attributes;KendoInput txtTwo = elements[3].As<KendoInput>();var z = txtTwo.Attributes;Debug.WriteLine(txtOne.InputValue);<br>Debug.WriteLine(txtTwo.InputValue);
<tbody class="ng-scope" ng-repeat="item in editBuildingFloorArea.placeSizes"><br><br><tr><br><br><td><br><br><span class="k-widget k-numerictextbox" style=""><br><br><span class="k-numeric-wrap k-state-default k-expand-padding"><br></span><br></td><br><br><td><br><br><td><br><br><td class="center"><br></tr><br></tbody><br><br><tbody class="ng-scope" ng-repeat="item in editBuildingFloorArea.placeSizes"><br><br><tr><br><br><td><br><br><span class="k-widget k-numerictextbox" style=""><br><br><span class="k-numeric-wrap k-state-default k-expand-padding"><br></span><br></td><br><br><td><br><br><td>
Hi All,
I have seen about 5 or 6 threads on this issue with no real solution or explanation given. I am in Visual Studio 2013 with Telerik Testing Framework. I am using examples provided by your support staff. I have added ArtOfTest.WebAii and Telerik.TestingFramework.Controls.KendoUI references to my solution. Then I have added the following namespaces to my test file (most of which I know are not necessary):
using ArtOfTest.WebAii;using ArtOfTest.WebAii.Controls;using ArtOfTest.WebAii.Controls.HtmlControls;using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;using ArtOfTest.WebAii.Core;using ArtOfTest.WebAii.ObjectModel;using NUnit.Framework;using Telerik.TestingFramework.Controls.KendoUI;
namespace VNextTelerik{ [TestFixture] public class Class1 { public Manager myManager; [SetUp] public void TestFixtureSetUp() { // Initialize the settings Settings mySettings = new Settings(); // Set the default browser mySettings.Web.DefaultBrowser = BrowserType.FireFox; // Create the manager object myManager = new Manager(mySettings); // Start the manager myManager.Start(); } [Test] public void Kendo() { myManager.LaunchNewBrowser(); myManager.ActiveBrowser.NavigateTo("http://demos.kendoui.com/web/numerictextbox/events.html"); System.Threading.Thread.Sleep(5000); myManager.ActiveBrowser.RefreshDomTree(); KendoInput textBox = myManager.ActiveBrowser.Find.ByExpression<KendoInput>("class=k-widget k-numerictextbox"); textBox.TypeText("50"); } [TearDown] public void TearDown() { // Shut-down the manager and do all clean-up myManager.Dispose(); } }Every time it runs (KendoInput textBox = myManager.ActiveBrowser.Find.ByExpression<KendoInput>("class=k-widget k-numerictextbox");) this returns null. I have tried many many things changing DomRefreshTree, waiting for element, longer thread.sleep (terrible solution). Ive tried to intialize the object as so(KendoInput textBox = new KendoInput).What could be the issue? Ive ran it at least 40 times and only one time did it actually find the object. Ive attached the solution. In all the other threads with this problem your support staff runs peoples project and says it works. I am looking for a reason this may be happening and a possible solution.
thanks
Hey Chummers,
I f***ing love this Framework!!
However, it seems that I am way to stupid to use it. :-D Hope you can help me out!
I am trying to click on a button, but always get a NotFoundException. So I wrote a small test containing the following code:
01.var app = myManager.ActiveApplication.MainWindow;02. 03.app.Find.Strategy = FindStrategy.AlwaysWaitForElementsVisible;04.IList<FrameworkElement> buttonList = app.Find.AllByType("Button");05. 06.foreach (var element in buttonList)07.{08. Debug.WriteLine(element.Name);09.}The output is
PART_SysMinimizeButtonPART_SysMaximizeButtonPART_SysRestoreButtonPART_SysCloseButtonSo it seems my code is only able to address the buttons in the Window-frame so far and I have no idea what do do...
Any suggestions?
Greetings Stephan
Assert.That(MyControl.Find.ByName("valueTextBlock").As<TextBlock>().Text, Is.EqualTo("Football"));Assert.That(MyControl.Find.AllByType<TextBlock>()[1].Text, Is.EqualTo("Football"));Hello,
There are 2 grids, one is used to find personnel, the other one is used to find divisions in which the personnel works
The same testing pattern applies to both grids: open the grid, type info in one or several input boxes and select a result. The first grid works fine, however, when using the second grid, it sometimes selects the first result from the list right after opening the grid. And I mean SOMETIMES, because sometimes sets the text in the input box, presses enter and then selects the wanted results, and sometimes it just selects the first result RIGHT AFTER opening the grid.
I'd like to know what could be the reasons that are causing this.
Thanks in advance.
private readonly DialogMonitor _dialogMonitor;public void HandleUploadDialog(string path, HtmlInputFile controll) { var dialog = new FileUploadDialog(Manager.Current.ActiveBrowser, path, DialogButton.OPEN); _dialogMonitor.Start(); _dialogMonitor.AddDialog(dialog); controll.Click(); dialog.WaitUntilHandled(10000); }
I attached a screenshot as an example of frozen window
Could you suggest me a solution? What could be a reason of such behavior? Is there any other way to handle this dialog?