Telerik Forums
Testing Framework Forum
3 answers
97 views
Hello,

While everyone knows Telerik components are the best, sometimes at my company we use a competitor's 3rd party components. Namely ComponentOne. I have a ComponentOne ComboBox - C1.Silverlight.C1ComboBox which I need to work with using the Test Framework. I cannot cast this using the ArtOfTest.WebAii.Silverlight.UI.ComboBox class as it throws an exception. I have to work with these other company's components during automation testing so there is no getting around it. How do I handle these cases? Just working with FrameworkElement is not sufficient for our purposes.

Thanks a bunch!
Cody
Telerik team
 answered on 15 Feb 2012
3 answers
86 views
Hi,
I tried to force my test to throw FindException, so I misspelled one of the IDs, to find element which in fact will be null. And indeed object is null, but FindException is not thrown (but test throws NullReferenceException due to following function, which tries to execute Click() on that element). What could be possible cause of that behavior and how to avoid it?

I'm running tests under .NET Framework 3.5 and nUnit 2.5.1 with WebAii 2011.2.1117.0
Plamen
Telerik team
 answered on 14 Feb 2012
2 answers
111 views
Hello everyone!

I'm having a little issue automating this site on a particular situation. To test this, we'll need to have at least one item in the "Saved Items" list. The steps are very simple:

1) Open this page.
2) Click "Save for Later" on the right-hand side, just below the "Add to Bag" button.
3) On the top-right corner, click on "My saved items".
4) Click on "Update Size and Quantity"

Here, we have the two "HtmlSelect" in question.

What I'm trying to do is selecting a size and, after the second combobox is refreshed, select a quantity.
The thing is, I can select a size without a problem, but the site doesn't recognize the "click" and doesn't refresh the second combobox.

This is my code for clicking on the comboboxes:
var sizeDropbox = itemSaved.Find.ByXPath<HtmlSelect>("//select[1]");
var selectedSizeIndex = new Random().Next(1, sizeDropbox.Options.Count - 1);
var selectedSize = sizeDropbox.Options[selectedSizeIndex];
sizeDropbox.SelectByIndex(selectedSizeIndex);

var quantityDropbox = itemSaved.Find.ByXPath<HtmlSelect>("//select[2]");
var selectedQuantityIndex = new Random().Next(1, quantityDropbox.Options.Count - 1);
var selectedQuantity = quantityDropbox.Options[selectedQuantityIndex];
quantityDropbox.SelectByIndex(selectedQuantityIndex);

(The itemSaved object is the TableRow parent element)

Can anyone help, please?

Best regards,
Ricardo Moura
Ricardo
Top achievements
Rank 1
 answered on 14 Feb 2012
2 answers
80 views
Hi there

I tried to run Silverlight appliction under Firefox brawser I get the error massege "443 user an invalid security certificate"
while when I run it under internet explorer I have no issue, your reply is much appreciated


Talal
Talal
Top achievements
Rank 1
 answered on 14 Feb 2012
3 answers
83 views
Hi

Can i use HierarchyConstraints in this example:

I know how to ID the child Node
I can ID the parent node(But not without the child)

Can i use HierarchyConstraint to instead of saying Find this child and then this parent 2 parents up. To just say this:

Find this child, then find a parent matching this htmlfindexpression(or similar) but not giving it a parent count to go up, so it will just move it way up until it finds the element or fail.


What I'm doing now is one of 2 things either use xpath or make a long htmlfindexpression with alot of | to get the elements, but i don't like this solution.
Anthony
Telerik team
 answered on 13 Feb 2012
3 answers
213 views
I have this line of code in my Test class:

DataGrid grid = app.Find.ByName("cboResident").As<DataGrid>();

I have taken it from this documentation page which indicates I can cast components on a Silverlight page to their "native" types (i.e. DataGrids, ComboBoxes, etc, instead of just returning FrameworkElement, which isn't serving its purpose in this case...) 

Here's the example given in the Telerik documentation:

Grid containerGrid = app.Find.ByText("SomeText").Parent("Grid").As<Grid>();

The problem is that I get a compile time exception that states:

Error: The type 'System.Windows.Forms.DataGrid' cannot be used as a type parameter 'T' in the generic type or method 'ArtOfTest.WebAii.Silverlight.FrameworkElement.As<T>()' There is no implicit reference conversion from 'System.Windows.Forms.DataGrid' to 'ArtOfTest.WebAii.Silverlight.FrameworkElement.'

This is the source of MUCH frustration w/my developers right now and we can't find how to resolve it. We get this compiler error regardless of which type of component we are attempting to cast the FrameworkElement to, whether it be a Silverlight component or something else, even a Telerik component, most frustrating of all.


Any help would be appreciated. 





Jess
Top achievements
Rank 1
 answered on 13 Feb 2012
1 answer
142 views
Hi

I wrote a while back about some problems I'm experiencing with Teleriks implementation of xpath. But before i didn't have a live website i could reference, I do now.

HtmlFindExpression h1 = new HtmlFindExpression("xpath=//h1");
.Find.ByExpression(h1)


The above will result in this error:
The ':' character, hexadecimal value 0x3A, cannot be included in a name.

When run against this website:
http://www.tradingfloor.com/posts/central-banks-deliver-end-of-month-boost--1013237813


NOTE:
This works as intended if i check it against Selenium.
Cody
Telerik team
 answered on 10 Feb 2012
5 answers
124 views
 When attempting an upgrade to the latest Firefox 10.0, I received a message that the Telerik plugin is not compatible and will be disabled.

Please Provide any solution for that....

Thanks and Regards,
Rohit Malhotra
Plamen
Telerik team
 answered on 09 Feb 2012
2 answers
91 views
I would like to set the FindStrategy globally so that whenever I do a Find on any of its children, I don't have to set the Strategy on this child to WhenNotVisibleReturnNull.

Even though I set the strategy to this on the application itself, if I'm calling Find on a control within the application, it reverts back to the default which I believe is WhenNotVisibleThrowException.

Which brings me to my next question: Why, oh why is that the default? Not knowing there was a FindStrategy caused me hours of painful googling. According to the documentation, the Find methods return null when the element doesn't exist. So WhenNotVisibleReturnNull I believe should be the default.

Many Thanks!
Dren
Top achievements
Rank 1
 answered on 09 Feb 2012
1 answer
112 views
Hello,

We have a Silverlight 5 application that we are writing tests for using the Testing Framework. One of the initial actions the code must handle is a dialog box that pops up and allows the user to select a particular customer they want to work with for that session. They can select/change customers at any point in the application. How do we code (we're coding in C#) for a "select" dialog box in the Test Framework?

Feedback appreciated. Thanks.

EDIT - Disregard, we figured it out. Thanks.
Anthony
Telerik team
 answered on 08 Feb 2012
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?