Not able to validate checkbox property

7 posts, 0 answers
  1. sonal
    sonal avatar
    6 posts
    Member since:
    Jun 2011

    Posted 28 Sep 2011 Link to this post

    I am trying Following code to validate check Box property
          
                  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
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 29 Sep 2011 Link to this post

    Hello Sonal,

    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
    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
  3. sonal
    sonal avatar
    6 posts
    Member since:
    Jun 2011

    Posted 05 Oct 2011 Link to this post

    That Works.
    Thanks Plamen.
  4. Christopher
    Christopher avatar
    2 posts
    Member since:
    Feb 2012

    Posted 24 Feb 2012 Link to this post

    So to verify a checkbox, a custom step is required? I would have thought this would be available as a regular non customized step. How about a verification check?

    Regards,

    Chris 
  5. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 28 Feb 2012 Link to this post

    Hello Christopher,

    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
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 29 Feb 2012 Link to this post

    Plamen,
    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
  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 01 Mar 2012 Link to this post

    Hi 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
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top