This is a migrated thread and some comments may be shown as answers.

Test on the RadGridView

4 Answers 153 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 20 Jan 2011, 07:51 PM
I have a Silverlight 4.0 application. In this app. I have a form that display data in a RadGridView and it is paged.  The user can click a button on the form that display a new form. In this one, he can fillin fields and submit it, this will create a new record on the database. The form is automatically close and the firt form is show again to user with a RadGridView that show the data, the GridView first page is loaded.

My question is, since I can have more than 1+ pages of data in my gridview and this one is set on the first page when the form load, how can I validate that my new entry is display in the gridview ? Can I do this by code ? Or does exist a validator for that kind of scenario ?

Thanks
Michel

4 Answers, 1 is accepted

Sort by
0
Michel
Top achievements
Rank 1
answered on 21 Jan 2011, 09:49 PM
Any idea ?
0
Stoich
Telerik team
answered on 26 Jan 2011, 10:54 AM
Hello Michel,
     Basically, you just want to validate that an element exists in your RadGridView, is this correct? RadGridView is a Telerik control and is fully integrated with WebUI Test Studio. You can setup numerous validations for every aspect of the RadGridView quickly and easily. Here's how it works:
start your recorder and enable Highlighting from the menu in the bottom-right corner. Now try hovering your mouse over the different Elements in your RadGridView. The elements will become highlighted in green as you do that. If you linger your mouse over an element for a few seconds, various "nubs" will appear (screenshot 1). Each "nub" represent a layer of your application you can validate. For instance if you highlight a RadGridCell the following options will appear:
-Textblock (because the "true" HTML element is a textbox)
-GridViewCell
-GridViewRow (the cell's containing row)
-RadGridView (the row's containing GridView)
you can perform validations on each level.
To actually create validations click on a "nub" and from the pop-up menu that comes up select "Quick Tasks". This will bring up a list of validations to choose from (screenshot 2).

I hope this info is enough to get you started with writing great UI tests, let me know how it goes!

Regards,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Michel
Top achievements
Rank 1
answered on 26 Jan 2011, 02:11 PM
Hi,

thank you for  your answer. This part of the anser : in your sample you select a specific row + a specific cell to validate the value. In my scenario the grid can have differents rows count from test to test. So if I create a new value, this value can be in the row 3, or in the row 15, row 21 ....I have no idea from test execution to next execution how many rows the grid can have.

So my  question is, in this context, how can I retreive the new cell to validate the new value ? It is sure that I have to make code behind to query the grid, but I do not know how to do this ....

Thank you

Michel
0
Stoich
Telerik team
answered on 26 Jan 2011, 05:09 PM
Hi Michel,
   WebUI Test Studio is all about saving time and avoiding coding unless it absolutely necessary. In this case you can just Edit the Find Expression for the element from the GUI. Record the step that uses the RadCombo Element - doesn't matter whether it's a Verify step or some other type.
Now go to TestView in QA edition and click on the step. You'll notice that an element in the Elements Explorer becomes highlighted by a yellow arrow in the bottom-right corner (see screenshot 1). This is the element used in the step. We want to edit its Find Expression to make it fit the description of all the Silverlight elements you'll be adding in the future.
Right-click on the element in the Elements Explorer and click "Edit Element". The "Find Expression Builder" comes up (screenshot 2). Now you need to change the Find Expression in order make sure it will find every Element you add in the Grid.
Remove the "automationid exact" and "XamlPath Exact" conditions and add some additional conditions that will fulfill the description of the element you'll be adding. For instance if the element has some specific Text content you can base your Find Expression on it by adding "Text Content contains". I can give you more specific guidelines if you give me more details on the element your adding to the GridView.

I hope this helps!

All the best,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Michel
Top achievements
Rank 1
Answers by
Michel
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or