Dear community!
We are using VS13 and the Telerik Framework to test our web client. For finding controls or to wait for specific conditions to be met, we wanted to use ArtOfTest.Common.WaitSync with the Manager.Wait.For<>(...).
We want to use this because we can not be sure if our page is fully loaded at certain points, and this Wait.For would be better than a stupid Thread.Sleep, because we can do things like refreshing the DOM tree each time the predicate is checked.
We experienced that there is a new Thread used for these WaitSynch methods.
Is there a way how to use the functionality of Wait.For<>(); without using different threads, to make the following code really wait until this method either times out or the predicate is true?
Best Regards
Hubertus
Hi, hospital form guy here, searched and didn't find anything
Just wondering, is there any way to stop a test if any errors appear in the console? Like is there a way to check? And I mean any errors, not just JavaScript ones or anything like that. And I'm not talking about logging the errors, just stopping the test and showing the console errors.
Thanks in advance.
Hi ,
I am running few test scripts .Error i am getting is "element not found" for hyperlinkbutton,DataGrid,Listbox.I tried to find it by name as well as by type,but nothing works for me.I used silverlight spy to get the properties of the element.Attached is the details I got using silverlight spy.
Below is the details of error
<ErrorInfo>
<Message>Test method FF_TEST.FINDING threw exception:
ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
FindExpression used:
[name 'Exact' dgProduct ]
</Message>
<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.ForVisible(Int32 timeout)
at ArtOfTest.WebAii.Silverlight.VisualFind.ReturnOrThrow(FrameworkElement e, String throwMessage)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByName(String name)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByName[T](String name)
</StackTrace>
</ErrorInfo>
my code is
var productGrid = app.Find.ByName<ArtOfTest.WebAii.Silverlight.UI.DataGrid>("dgProduct");
I tried below line as well
var productGrid = app.Find.ByName("dgProduct").As <DataGrid> () ;
it was noticed that productGrid variable is getting assigned with null value.
Similar issue is found with other controls like hyperlinkbutton ,listbox and label
Please guide me to solve this issue
Hi, hospital form guy here
Situation: every hospital form has the same header which uses the same piece of code for testing. I currently have 2 form tests written. Problem is, the same code is copy-pasted in both tests. If I want to make changes to the header code, I have to change it in every test, which is not very convenient.
Situation that would be useful:
1. Launch test
2. Test includes the header code and tests it.
3. Test continues running its test-specific code.
How could I achieve this? Thank you in advance.
HtmlListItem liItem = Find.ByExpression<HtmlListItem>("id=56e5c928-4413-4a36-8676-72bea0c4e51d");
liItem.Find.ByExpression<HtmlImage>("class=menu-button").MouseClick();
I'm trying to find a parent Div by the <h2> TextContent = "Cleaning and Inspection (LLT)" by iterating throw aReadOnlyCollection of HtmlDivs and get a NullException.
public ReadOnlyCollection<HtmlDiv> InfoObjectList { get { return GetDataTab().Find.AllByExpression<HtmlDiv>("class=infoObjPrint"); } } public virtual HtmlDiv GetInfoObject(string infoObjectText) { foreach (var item in InfoObjectList) { var text = item.Find.ByContent("h2").TextContent.Trim(); if (text.Equals(infoObjectText)) { return item; } } return null; }
<div class="infoObjPrint" id="S05842977912008092400000"> <a data-name="S05842977912008092400000"></a> <h2><span class="searchTermHighlight">Cylinder Head</span> Cleaning and Inspection (LLT)</h2> <div class="tipsContainer" data-id="S05842977912008092400000"></div> <p> <span class="clsListTitle">Tools Required</span> </p> <ul class="clsBULLET"> <li> <span class="clsEmphBOLD">EN 46122 </span>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>