Automated Testing for Batch Update Telerik Grid

2 posts, 0 answers
  1. skaw
    skaw avatar
    1 posts
    Member since:
    Jun 2012

    Posted 06 Jun 2013 Link to this post

    We need help in writing automated test scripts for testing Telerik Batch Update Grid. Our automation script fails while trying to enter values into text boxes on edit of the grid. Clicking on the cell of the grid does not open the text box when we use our automated script.

    Would appreciate any help on this...

    Our script looks like something like this...

    driver.Click("/html/body/div[8]/div/form/table/tbody/tr/td[5]/span");
    driver.Click("//form[@id='POLinesform']/table/tbody/tr/td[@id='LineNumber' and text()='1']/../td[@id='Warehouse']");
    driver.ClearSendKeysWithName("Warehouse", testPo.warehouse);


    Let me know if more information is needed.

    Thanks
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 11 Jun 2013 Link to this post

    Hello skaw,

    Does your grid behave like this online demo?
    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx

    In this demo it requires a double click to put the cell into edit mode. This code works to update this particular grid.

    // Find the grid we want to update
    RadGrid grid = ActiveBrowser.Find.ByExpression<RadGrid>("id=?RadGrid1");
     
    // Locate the cell to be updated
    HtmlTableCell cellToEdit = grid.MasterTable.Rows[1].Cells[1];
     
    // Put the cell in edit mode by a mouse doubleclick
    cellToEdit.MouseClick(MouseClickType.LeftDoubleClick);
     
    // Locate the <input> element that is added when the cell enters edit mode
    HtmlInputText inputBox = cellToEdit.Find.ByTagIndex<HtmlInputText>("input", 0);
     
    // Give it a new value
    Actions.SetText(inputBox, "New Value");
     
    // Exit edit mode by clicking on a different cell. Any cell will do.
    grid.MasterTable.Rows[1].Cells[0].MouseClick();


    If your grid behaves differently, can you point me to a publicly accessible URL where I can see its behavior and come up with a solution to automate it?

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top