SortedList<float, GridViewHeaderCell> columns = new SortedList<float,GridViewHeaderCell>();
RadGridView grid = Pages.proj1.SilverlightApp.MasterDataGridTigerradgridview;
GridViewHeaderRow header = grid.HeaderRow;
IList<GridViewRow> rows = grid.Find.AllByType<GridViewRow>();
/* GridViewCell cell = rows[r].Cells[StatusCol];
cell.User.Click(MouseClickType.LeftDoubleClick);
cell.Refresh();
FrameworkElement Active = cell.Find.ByAutomationId("activeCheckBox");
if (Active.IsChecked == false)
Active.Check(true);*/
I am getting following error for last two row this code,
c:\Automation1\Manage Jobs\DATA\JobDimention\ADD_JobDimention.tstest.cs: Line 145: (CS1061) 'ArtOfTest.WebAii.Silverlight.FrameworkElement' does not contain a definition for 'Check' and no extension method 'Check' accepting a first argument of type 'ArtOfTest.WebAii.Silverlight.FrameworkElement' could be found (are you missing a using directive or an assembly reference?)
Can you you guide me how can i fix this issue?
Note : Check box in part of RadGridCell as shown in attached screenshot
10 Answers, 1 is accepted
I'm sorry you are running into this problem. FrameworkElement is base class that represents any visual element in the Silverlight application, but it doesn't contain "IsChecked" property and "Check" method. Please use the CheckBox class instead. Here is the code:
RadGridView grid = Pages.proj1.SilverlightApp.MasterDataGridTigerradgridview;
IList<GridViewRow> rows = grid.Find.AllByType<GridViewRow>();
GridViewCell cell = rows[r].Cells[StatusCol];
cell.User.Click(MouseClickType.LeftDoubleClick);
cell.Refresh();
CheckBox Active = cell.Find.ByAutomationId<CheckBox>(
"activeCheckBox"
);
//CheckBox Active = cell.Find.ByType<CheckBox>();
if
(Active.IsChecked ==
false
)
Active.Check(
true
);
Hope this helps!
Kind regards,
Plamen
the Telerik team
Thanks Plamen.
Regards,
Chris
No, coded step is not required in this particular scenario. I just showed to Sonal how to modify the code to work correctly. The same scenario can be easily accomplished through the Test Studio UI. Here's a video demonstrating that.
Regards,
Plamen
the Telerik team
Test Studio Trainings
I like your solution however I think Christopher was looking for was a dynamic solution for Grid with different number of rows.
My Two Cents,
John
Could you please elaborate more on what do you mean by "dynamic solution for Grid with different number of rows". If you have a specific scenario, please explained it to me in details, so that I can assist you in finding the best solution for it.
Kind regards,
Plamen
the Telerik team
Test Studio Trainings
Hi Ruud,
Please, note that you refer to a thread from 8 years ago so the video wouldn't be relevant. Anyways, during that time we have worked on improving the features in Test Studio and enhancing the user help documentation, so I hope I correctly understood what you are stuck with and will refer the suitable resources.
As far as I understand you would like to have a step within a test, which verified what is the state of a checkbox - whether checked or not. Test Studio allows you to add verification steps, which can verify different attributes of the elements on page. One way to add a verification is to choose one of the quick verification options in the Elements menu during a recording session. Alternatively, you can access further options to verify the state of an element through the Build step... option, which allows you to add Advanced verifications.
I hope this will be helpful for you to sort out your struggles. If I have misread what troubles you experience, please, do not hesitate to get back to me and provide further details about the faced difficulties.
Thank you in advance for your understanding and cooperation.
Regards,
Elena
Progress Telerik
Please check if it works
Hi Vedha,
Can you, please, elaborate more on the difficulties you experience? What is the scenario you are trying to cover and what outcome you see from the shared code? Did this piece of code used to work before and it suddenly stopped? Or this is the first time you are trying to set it up and it doesn't perform as you expect it?
Will it be possible to prepare a sample test against a public available page to demonstrate the misbehavior? I guess you can use any of the Telerik controls demo page (this grid seems to be similar to the one you are automating).
I am looking forward to hearing back from you.
Regards,
Elena
Progress Telerik