Telerik Forums
Testing Framework Forum
22 answers
523 views
Hi

I'm getting an error when doing waitforelement to disappear, see below.

Any ideas to whats going wrong?, if i put in a sleep of 2sec or so it works. My guess is that the wait happens between dom refreshes or something like that but i don't know how to get around it.

Whats happening on the page, is that click save Btn closes a modal popup and I attempt to wait for it to disappear.

Code:
private HtmlFindExpression modalH2 = new HtmlFindExpression("xpath=//div[@id='tf-modal-window-top']/h2");
 
_Frame.Find.ByExpression<HtmlAnchor>(saveButton).Click(true);
ActiveBrowser.WaitForElement(modalH2, SharedValues.LongtTimeout, true);


Error:
Test method Iit.TradingFloor.TestWebUI.UrlRedirectionTests.UrlRedirection_Admin_SearchRedirection threw exception:
System.ApplicationException: Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Refresh() failed due to an unexpected exception. ---> ArtOfTest.WebAii.Exceptions.FindException: Find Details:
- No FindParams defined.
- Start Element: [Element: 'html:0']
 
 
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh(Boolean forceDomTreeRefresh)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at ArtOfTest.Common.WaitAsync.CallRefreshIfNeeded[T](T target)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)

Cody
Telerik team
 answered on 19 Jan 2015
2 answers
60 views
I want to get the HelpText property of a custom silverlight control using ArtOfTest.webii .I have added automation peer to the HelpText property of that control,so want to fetch the HelpText using testing framework
I am using FrameworkElement to store the custom silver light control.I have tried using automation properties ,but it say HelpText is not a valid automation property.          Please help in this.I need it urgent.
Cody
Telerik team
 answered on 17 Jan 2015
9 answers
158 views
Hi

How can I retrieve Style properties like 'Fill', 'Background', ... from Rectangle or Canvas ?
I tried to retrieve the Fill property with the following code:

var fillBrush = networkOverlay.GetProperty(new AutomationProperty("Fill", typeof(System.Windows.Media.Brush)))

But I get the follwing exception:

[WPF Extension Error] Details: System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
   bei System.Windows.Threading.Dispatcher.VerifyAccess()
   bei System.Windows.Freezable.ReadPreamble()
   bei System.Windows.Media.Brush.ToString()
   bei Telerik.TestingFramework.XamlExtension.ClientProcessor.ObjectToString(Object obj, Boolean isAutomationPeer, Type objType)
   bei Telerik.TestingFramework.XamlExtension.ClientProcessor.ProcessCommand(String command)

When I tried to directly retrieve the Fill property:

var fillBrush = myRectangle.Fill;

I get the following exception:

[WPF Extension Error] Details: System.ArgumentException: Object of type 'ArtOfTest.WebAii.Controls.Xaml.Wpf.Canvas' cannot be converted to type 'ArtOfTest.WebAii.Controls.Xaml.Wpf.Visual'.
   bei Telerik.TestingFramework.XamlExtension.TechSpecific.DispatcherInvoke(Dispatcher dispatcher, Delegate call, Object[] args)
   bei Telerik.TestingFramework.XamlExtension.ClientProcessor.ObjectToString(Object obj, Boolean isAutomationPeer, Type objType)
   bei Telerik.TestingFramework.XamlExtension.ClientProcessor.ProcessCommand(String command)

Thank your for your assistance.
BenoƮt
Boyan Boev
Telerik team
 answered on 16 Jan 2015
9 answers
164 views
My current issue is triggering the following HtmlInputText using the provided api.

This textbox is not in a valid state even after entering text using the HtmlInputText.Text property. 

The only work around is to simulate keyboard keypresses on the textbox.

There MUST be a less brittle approach, thanks for your time.

'invalid'
<input type="text" class="field ng-pristine ng-invalid ng-invalid-required ng-valid-maxlength ng-touched" size="25" maxlength="35" name="billing_first_name" id="billing_first_name" ng-class="{submitted: submitted}" ng-maxlength="35" ng-model="Cart.BillingAddress.FirstName" ng-required="true" required="required">

'valid'
<input type="text" class="field ng-valid-maxlength ng-touched ng-dirty ng-valid ng-valid-required" size="25" maxlength="35" name="billing_first_name" id="billing_first_name" ng-class="{submitted: submitted}" ng-maxlength="35" ng-model="Cart.BillingAddress.FirstName" ng-required="true" required="required">
Cody
Telerik team
 answered on 15 Jan 2015
7 answers
124 views
Am I correct in understanding that the only way to run tests created by the testing framework is with MbUnit, NUnit, VS Team Test, or XUnit? It would be more beneficial for me to be able to run a test using a windows forms. 

Thanks. 

Adam. 
Boyan Boev
Telerik team
 answered on 15 Jan 2015
6 answers
158 views
Is there an updated .chm file for the latest version of the framework?  The on installed with the latest framework is from 2012 and is woefully out of date...
Ivaylo
Telerik team
 answered on 12 Jan 2015
6 answers
759 views
Hi,

I have a requirement where I have to test the position of different Elements.
This position is set in our application using a Parent Cancas as container. Then our custom user controls are placed using Cancas attached properties: "Top" and "Left".

In our test scenario we tried to retrieve this value withe the following code:

var left = userControl.GetAttachedProperty<double>("Canvas", "Left");<br>var top = userControl.GetAttachedProperty<double>("Canvas", "Top");

But this code throw an exception:
[WPF Extension Error] Details: ArtOfTest.WebAii.Silverlight.NoSuchPropertyException: Unable to find attached property owner class 'Canvas'
   bei Telerik.TestingFramework.XamlExtension.ClientServices.GetAttachedPropertyValue(AutomationProperty property, Object obj)
   bei Telerik.TestingFramework.XamlExtension.ClientServices.GetRealProperty(AutomationReference reference, AutomationProperty property)
   bei Telerik.TestingFramework.XamlExtension.ClientProcessor.ProcessCommand(String command)

Do I do something wrong? Is there a way to test the position of UI elements ?

Thanks.
BenoƮt
Boyan Boev
Telerik team
 answered on 06 Jan 2015
2 answers
127 views
Can we use Telerik Testing Framework as API in Visual Solution??

Not like dll....

If Yes, Please let me know....
Cody
Telerik team
 answered on 05 Jan 2015
4 answers
150 views
Hello Telerik Team!

I have been having difficulties handling a simple dialog box in chrome.
The alert is handled properly in IE, FireFox, and Safari.

This is the code I'm using to handle everything. I've tried using an 'AlertDialog' for chrome but that doesn't seem to work either.

iFrame.RefreshDomTree();
man.DialogMonitor.AddDialog(new ConfirmDialog(ab, DialogButton.OK));
man.DialogMonitor.Start();
iFrame.Actions.Click(iFrame.Find.ById("btnDelete"));

http://imgur.com/F2VTeHp

Any ideas?
Cody
Telerik team
 answered on 23 Dec 2014
2 answers
168 views
Hi,
I am just starting and i am very new to this , please help me with this beginner que
When i use the find element by xpath the element is not getting discovered 

ActiveBrowser.Find.ByXPath<HtmlSpan>(".//*[@id='treeview']/ul/li[1]/div/span[2]/span[2]");
Boyan Boev
Telerik team
 answered on 19 Dec 2014
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?