This is a migrated thread and some comments may be shown as answers.

Automated Testing for Batch Update Telerik Grid

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
skaw
Top achievements
Rank 1
skaw asked on 06 Jun 2013, 06:18 PM
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

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 11 Jun 2013, 04:58 PM
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
Tags
General Discussions
Asked by
skaw
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or