If I add 2 users on the datagrid, the source code looks like the following one:
public ArtOfTest.WebAii.Silverlight.UI.Button Item30Button
{
get
{
return Get<ArtOfTest.WebAii.Silverlight.UI.Button>("XamlTag=grid", "name=AcEditor", "|", @"XamlPath=/datagrid[0]/grid[0]/border[0]/grid[name=Root]/scrollviewer[0]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/datagridrowspresenter[automationid=RowsPresenter]/datagridrow[1]/datagridfrozengrid[name=Root]/datagridcellspresenter[name=CellsPresenter]/datagridcell[2]/grid[name=Root]/contentpresenter[0]/button[0]");
}
}
If I delete the users , the source code removes the above bold part .
public ArtOfTest.WebAii.Silverlight.UI.Grid RootGrid
{
get
{
return Get<ArtOfTest.WebAii.Silverlight.UI.Grid>("XamlTag=grid", "name=AcEditor", "|", "XamlPath=/datagrid[0]/grid[0]/border[0]/grid[name=Root]");
}
}
In this situation, how do I validate no users on the datagrid since I can't click any row on the datagrid?
Thank you,
Ray
7 Answers, 1 is accepted
Thanks for the post and the question. So from what you describe, it sounds like a user is an entry in the Silverlight grid, right?
From the code, it looks like you have a reference to RootGrid, but if you can try adding the child DataGrid as shown in the attached screenshot.
You can then write in a custom code Assert with the DataGrid reference similar to this (please see the attached screenshot on how to access the reference in code):
Pages.SilverlightControls.SilverlightApp.Item0Datagrid.Refresh();
Assert.IsTrue(Pages.SilverlightControls.SilverlightApp.Item0Datagrid.Rows.Count == 0);
Sincerely,
Nelson Sin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Hi, Nelson
Thanks for your reply. I am new to WebUI Test Studio. When I record the Silverlight using WebUI Test studio and I only can see SilverlightApp in project.cs. I don’t know how to let SilverlightControl appear automatically. J
All cs files are Pages.SilverlightApp, not Pages.SilverlightControls.SilverlightApp .
Thanks,
Ray
public SilverlightAppElement SilverlightApp
{
get
{
ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl plugin = Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl>("id=silverlightControlHost", "|", "tagIndex=object:0");
int appIndex = plugin.OwnerBrowser.GetSilverlightAppIndex(plugin);
return new SilverlightAppElement(plugin.OwnerBrowser.SilverlightApps()[appIndex].Find);
}
}
Sorry if my last reply was not specific enough. Please do not edit the Project.cs file, the code there should be auto generated by WebUI and you should not need to change code manually in the file.
The code I posted was for a custom verification in a customized test step. Please see the following quick start guide links for adding code in either QA or Dev Edition under the topic heading 'Customizing Your Test Using C# or VB.NET Code'
You can then add the generic Silverlight DataGrid and custom verification step I described in my last post. But I forgot to mention also, a Telerik SL RadGridView should have built in Row Count Verifications.
Please see the attached screenshot on what this should look like and you can do this with the following steps:
Highlight the RadGridView -> select the RadGridView translator fanout -> select Build Verification in the Elements Menu -> select Count Verification in the Sentence Verification Builder
All the best,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Just wanted to check back with you on this. Please let us know if you have any questions on this.
Greetings,
Nelson
the Telerik team

I believe that it should be the issue of the dev's code. I still can't find that function per your instruction. :)
I'm attaching a couple flash videos that illustrate adding the verifications for a Rad Silverlight Data Grid and a generic Silverlight tool kit grid. Both videos were recorded using QA edition, but the process is similar in Dev Edition.
For the Rad Silverlight Data Grid, I am recording against this demo page. Please note that I increased the time out for the row count verification step to wait for the grid to load on the page.
For the generic Silverlight tool kit grid, I am using this demo page and its DataGrid. Please note the following for this video:
- I am adding the 'DataGrid' element from the Visual Tree in the Dom Explorer Window
- I am using slightly modified code from my first post in a customized step
- The code references the 'DataGrid' element that was added to the project
Please reply back if you have any questions on this.
Sincerely,
Nelson
the Telerik team
Just wanted to check back and see if you got this working.
Sincerely,
Nelson
the Telerik team