Telerik Forums
Testing Framework Forum
1 answer
125 views

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

Hubertus
Top achievements
Rank 1
 answered on 06 Nov 2015
23 answers
1.1K+ views
hi,

My application has a table, i have to search for an item in a table. How to do that?

Thanks
Sudarshan
Boyan Boev
Telerik team
 answered on 22 Oct 2015
5 answers
193 views

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.

veri555999
Top achievements
Rank 1
 answered on 20 Oct 2015
5 answers
267 views

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

Ivaylo
Telerik team
 answered on 16 Oct 2015
4 answers
121 views

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.

veri555999
Top achievements
Rank 1
 answered on 15 Oct 2015
6 answers
242 views
Hi,

I try to use Find.jQuery() to click on a picture in a dynamically javascript generated tree, but i don't understand how it works. :(

As you can see in attachments (F12 in Chrome), the highlighted line is the element that I try to click.

In first i've just tried to use Find.ByExpression but it always returns null in liItem  (The parent LisItem have a unique guid as id)
HtmlListItem liItem = Find.ByExpression<HtmlListItem>("id=56e5c928-4413-4a36-8676-72bea0c4e51d");
liItem.Find.ByExpression<HtmlImage>("class=menu-button").MouseClick();
I think it's due to the fact that the code is not html hardcoded but generated by JS.

How can I use Find.jQuery() (or another function) to make a MouseClick on this picture ?

Thanks :)
Boyan Boev
Telerik team
 answered on 15 Oct 2015
2 answers
109 views

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>

Boyan Boev
Telerik team
 answered on 12 Oct 2015
2 answers
157 views

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.

Ivaylo
Telerik team
 answered on 07 Oct 2015
1 answer
303 views

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);

Ivaylo
Telerik team
 answered on 05 Oct 2015
2 answers
150 views

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>

 

Boyan Boev
Telerik team
 answered on 02 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?