Telerik Forums
Testing Framework Forum
3 answers
181 views
Hi All,

I'm using Telerik testing framework to automate WPF application tests for quite some time (3 years). All the time as of version 2012.2.1204. It's an old one, but the most stable so far. I was trying to update to some latest 2015, but there is a critical bug, that I will clarify separately.
So this version is quite stable, except one issue that we've been experiencing from time to time. Lately, it's started happening every night and creates a real problem. We have several sets of tests running every night. Each set has approximately 20 tests of 2-7 minutes each. At the middle of a test (different test all the time), the tests stop running with the exception below. Even NUnit timeout attribute in tests with the value of 10 minutes doesn't help. All tests are hung with a circle of exceptions until TeamCity stops it.

Could you advise what might be wrong and what can I do to avoid this exception and make test running smoothly?
Thank you.


Thread id=4684
M-->U
[IL Method without Metadata]
at System.IO.Pipes.PipeStream.WriteFileNative(Microsoft.Win32.SafeHandles.SafePipeHandle handle, System.Byte[] buffer, System.Int32 offset, System.Int32 count, System.Threading.NativeOverlapped* overlapped, System.Int32& hr) 
at System.IO.Pipes.PipeStream.WriteCore(System.Byte[] buffer, System.Int32 offset, System.Int32 count) 
at System.IO.Pipes.PipeStream.Write(System.Byte[] buffer, System.Int32 offset, System.Int32 count) 
at Telerik.TestingFramework.WpfExtension.WpfCommunication._browserRemoteClient_BrowserRequest(System.Object sender, ArtOfTest.WebAii.EventsArgs.BrowserCommandEventArgs e) 
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoteClient.ProcessBrowserRequest(System.Object sender, ArtOfTest.WebAii.EventsArgs.BrowserCommandEventArgs e) 
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoteClient.ListenThreadEntry(System.Object objParam) 
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object state) 
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) 
at System.Threading.ThreadHelper.ThreadStart(System.Object obj) 
U-->M


Thread id=7984
at System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) 
at System.Threading.WaitHandle.WaitOne(System.Int32 millisecondsTimeout, System.Boolean exitContext) 
at System.Threading.WaitHandle.WaitOne() 
at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.AsyncPipeRead(System.IO.Pipes.PipeStream pipe, System.Byte[] bytes, System.Int32 offset, System.Int32 count) 
at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.ReadCommandFromPipe<ArtOfTest.WebAii.Messaging.Process.PipeCommand>(System.IO.Pipes.PipeStream pipe) 
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoteClient.ListenThreadEntry(System.Object objParam) 
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object state) 
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) 
at System.Threading.ThreadHelper.ThreadStart(System.Object obj) 
U-->M
Ivaylo
Telerik team
 answered on 10 Nov 2015
1 answer
132 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
202 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
275 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
127 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
276 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
117 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
167 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
323 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?