WebApp: Clicking on a button in a grid cell
Hello Community.
I'm having an issue that I can't figure out and hopefully someone can help me. I have a grid on a web application that has several rows and columns. I know the sample pic below shows the same name but for the purpose of this thread lets say the names are SaveIncomplete1, SaveIncomplete2, etc.
I want to click on the edit button for say SaveIncomplete1 but I'm unable to do so. I've tried using Xpath Descendant, and Sibling but it always errors out. Any suggestions are greatly appreciated.
Regards
Can you post the code of what you've actually tried?
Here's what we're doing. These two functions combined can take any table and, given the particular set of parameters, click on the child link within the found cell within the table.
function findRow(tableObject, stringSearch, searchColumn, maxRows = 0) { var cellFound = Utils.CreateStubObject(); var upperLimit; if (maxRows == 0) { upperLimit = tableObject.RowCount; } else { upperLimit = maxRows; } if ((searchColumn == 999) || (searchColumn == undefined)) { cellFound = tableObject.FindChild('innerText', aqConvert.VarToStr(stringSearch) + '*', 0, true); } else { for (var i = 1; i < upperLimit; i ++) { if (aqString.Trim(tableObject.Cell(i, searchColumn).innerText) == aqString.Trim(aqConvert.VarToStr(stringSearch)) ) { cellFound = tableObject.Cell(i, searchColumn); break; } } } if (cellFound.Exists) { return cellFound.RowIndex; } else { return -1; } } function clickTableColumn(stringToFind, objectTableInput, colIndexToClick, searchColumn = 999) { var rowFound; if (objectTableInput.Exists) { rowFound = findRow(objectTableInput, stringToFind, searchColumn); objectTableInput.Cell(rowFound, colIndexToClick).Child(0).scrollIntoView(true); objectTableInput.Cell(rowFound, colIndexToClick).Child(0).Click(); } else { throw Error('Unable to find the table '+ objectTableInput.MappedName) ; } }