Telerik Forums
Testing Framework Forum
9 answers
133 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
141 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
106 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
131 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
685 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
112 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
123 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
145 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
3 answers
178 views
Hi all,

We have faced with issue that  MouseClick doesn't work at all in our framework under different browsers for different controls. The following construction doesn't even make the mouse move

HtmlAnchor FindButton = Manager.ActiveBrowser.Find.ById<HtmlAnchor>("ctl00_cphBody_btnLogin");
FindButton.MouseClick(MouseClickType.LeftClick);

If we create a new test without our automation framework using pure Telerik construction the same lines works correctly. If the use the same test using pure Telerik construction but put it in our framework solution - the desktop mouse doesn't work at all. The app.config with the same webaii setting was used in both scenario, and the same test under same browser.

I have performed some debugging of Telerik libraries and found that were is difference how the Win32.Point object is initialized for the same button using same browser position (Please see the screenshot for details.) unfortunatelly i was not to debug further.
inputData = new Input[1];
InitializeMouseEvent(ref inputData[0], num, num2, 0x8002, true);

You can notice that in mouse not working situation the dwExtraInfo field for the KEYBDINPUT class is set to 0, in working situtation this value is initialized to 32771. If i modify the dwExtraInfo field in the KEYBDINPUT class and set it value to 32771 from 0, the 37771 value in the MOUSEINPUT class time field wil be initialized to 32771 as well.

If i modify the dwExtraInfo in the KEYBDINPUT class  in case mouse was working correctly and set it value to
0 and when to 37771  - same value is also assigned to the dwFlags field will be initialized to 32771. 

So it seems that in those 2 situations the Input class is constructed differently internally, with dwExtraInfo int pointer referencing to different fields. This is the only clue that i have why the desktop mouse is not working

Telerik version: 2014.3.903.0
Boyan Boev
Telerik team
 answered on 15 Dec 2014
1 answer
103 views
Hello,

I am working on testing a web application that requires localization and so Unicode characters.

When the line below is executed on a text area, for a brief moment the ó in opinión appears correctly typed but then it is reverted back to o.

browser.Desktop.KeyBoard.TypeText("comentario de opinión", 50, 0, true);

The final text on the control is "comentario de opinion"

I am using the latest TTF version. 

Thanks!




Boyan Boev
Telerik team
 answered on 05 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?