Here is my code:
GridDataTableObject.ActivateCell iRow, "CheckedColumn"
GridDataTableObject.SetCellData iRow, "CheckedColumn", "TRUE"
If I put this at the last line of my script, so that QTP exits after this, it will check the checkbox in the column cell fine.
However if I add any other code after this, or if this is part of a QTP RunAction command where I am performing multiple iterations of this script, so that muliple items are being selected and checked back to back, it will lock both the AUT and QTP. I can launch Windows Task Manager, and end the AUT process, then QTP will release.
High logging in QTP captures nothing.
Hello,
If the grid is on a dialog or a form that is being closed after the value is being set, it is possible that the form is being closed while the cell is still in edit mode and this may cause issue with QTP. If this is the case, you can work around this by simply activating a row after you call SetCellData. In that case, you could add the following line of code:
GridDataTableObject.ActivateRow 0
If that isn't the cause of the issue and the above doesn't resolve the issue, then you could also test SetInvalidDataCell instead of SetCellData. This method takes the same parameters as SetCellData, but the way the value is set is different and this may resolve some issues depending on what events your developers have handled.
Let me know if either of the above two methods resolve this issue or if you have any questions with this matter.
Alan
Thanks for the reply Alan. I tried SetInvalidDataCell, it locked immediately on that line. When I use SetCellData, it will set the checkbox, but it will lock if you do anything else to the grid, such as ActivateRow or SelectRow.
The grid is always open in the GUI, not on a form or anything else that is being closed or even visibliy refreshed in any way.
In QTP v9.2, we can use SetCellData without any lockup. It only locks up both QTP and the AUT when used with QTP v10.
I answered your question here.