Dynamically Generated Grid Verification

6 posts, 0 answers
  1. Jai
    Jai avatar
    9 posts
    Member since:
    Oct 2014

    Posted 19 Jan 2015 Link to this post

    Hi,

    I have a requirement where I have to verify the each content on Kendo grid and then click on it.All the contents in this grid is auto post values,We are able to modify the dose field alone.

    This grid was developed by using kendo gird, I can't be able to verify it even after recording it and tried little c# codes :

    KendoGrid grid = ActiveBrowser.Find.ById<KendoGrid>("grid");

    foreach (KendoGridDataItem row in grid.DataItems)
    {
     if (row.Cells[1].InnerText.Contains("250:00"))
      {
       ConfirmDialog cd = new ConfirmDialog(ActiveBrowser, DialogButton.OK);
       Manager.DialogMonitor.AddDialog(cd);
       Manager.DialogMonitor.Start();

       row.Cells[1].MouseClick();

       cd.WaitUntilHandled();
       Manager.DialogMonitor.RemoveDialog(cd);
      }
    }

    - Above Coded step also not fulfilled my scenario.

    These are the following scenarios,I need to verify :


    Scenario 1 :

    Need to verify the respective Time,Dose's are posted correctly while at the first time of grid open.

    Scenario 2 :

    Whenever i am changing the value of dose field in grid,it should affect this parent control(dose).


    Please,Help me on this.
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 22 Jan 2015 Link to this post

    Hi Jai,

    Thank you for contacting us.

    If you modify the cell and immediately after that verify it you should refresh the cell first: cell.Refresh().

    If the issue persists please send us the execution log so we can review it. 

    Could you please capture a screen recording of the test  recording and reproducing the issue, so we can better understand the exact scneario? Jing is a good free screen recorder for up to 5 minutes of recording time.

    Hope to hear from you soon.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Jai
    Jai avatar
    9 posts
    Member since:
    Oct 2014

    Posted 22 Jan 2015 Link to this post

    Hi

    Thanks for the reply.

    Troubles I face when verifying each values in grid are as follows:

    1.I'm unable to insert a new dose value in grid , as i did in the video.
    2.I'm unable to verify each values in each single column in the grid.
    3.I'm unable to insert a value in Base Schedule column in the grid.

    Herewith, I have enclosed the video, which shows the problem I have mentioned above.

    I'm also providing you a jsfiddle link which has Dynamically generated grid process in detail.

    You can find this by using this link :

    http://jsfiddle.net/Rajesh989/vy7earq5/1/   

    I'm unable to verify and focus the fields inside the grid. 

    [Note : The grid has been developed by using Kendo]

    I hope this will help you to understand better.
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 27 Jan 2015 Link to this post

    Hi Jai,

    Here is the code against that site:

    //Find the iFrame
                FrameInfo frameInfo = new FrameInfo("", "result", "http://fiddle.jshell.net/Rajesh989/vy7earq5/1/show/", 1);
                ArtOfTest.WebAii.Core.Browser frame = ActiveBrowser.Frames[frameInfo];
                //Find the Kendo input
                HtmlDiv div = frame.Find.ById<HtmlDiv>("Top");
                KendoInput input = div.Find.ByAttributes<KendoInput>("class=~k-numerictextbox");
                input.Clear();
                //Type 500
                input.TypeText("500");
                HtmlTable table = div.Find.ByAttributes<HtmlTable>("class=~k-focusable");
                HtmlTableRow doseRow = table.Find.ByAttributes<HtmlTableRow>("data-id=1");
                //Find the second cell of the first row under Dose
                HtmlTableCell secondCell = doseRow.Cells[1];
                secondCell.Focus();
                //Wait 2 sec so the cell can be updated
                System.Threading.Thread.Sleep(2000);
                //Refresh the cell so the DOM can be refreshed with the correct value.
                secondCell.Refresh();
                //Verify the cell
                Assert.AreEqual<string>("500.00", secondCell.TextContent);
                //Click the cell so it can be modidified.
                secondCell.MouseClick();
                System.Threading.Thread.Sleep(2000);
                secondCell.Refresh();
                KendoInput inputEdit = secondCell.Find.ByAttributes<KendoInput>("class=~k-numerictextbox");
                inputEdit.Clear();
                inputEdit.TypeText("1000");

    Please notice that you should wait some seconds then refresh the cell so the DOM can be updated.

    Hope this helps.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  5. Jai
    Jai avatar
    9 posts
    Member since:
    Oct 2014

    Posted 28 Jan 2015 Link to this post

    Hi Boyan Boev,

    Thanks for the reply.

    Its working very fine and Thanks for your efforts.
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 29 Jan 2015 Link to this post

    Hello Jai,

    Glad to hear that.

    If you need further assistance please let us know.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top