I have recorded the step for checking a checkbox in a table. It looks like this:
SwfWindow("Analysis Test Application").SwfTable("analysisSetupGridView").SetCellData 0,"Tabulate?",True
However, when playing this back, I get the following error:
SetCellData :Specified cast is not valid.. Row = 0, Column = Tabulate?, Value = True
I have tried using True, "True", 1, -1, "1" and "-1" and I keep getting an error. Oddly enough, if I try to check a checkbox that is already checked, the statement does not produce an error. Can somebody shed some light on this?
Mike
Hi Mike,
My thought would be that your Checkbox column may not have a boolean datatype. The way SetCellData works is that it sets the underlying columns value to the value supplied. Sometimes the column can display an editor that would imply a specific data type, such as checkbox is boolean, but actually be something else entirely. To confirm this what I would recommend is to manually set a cells checkstate to checked, then call GetCellData. This should likely give you an idea of what the value needs to be.
Originally, I recorded the steps to check and uncheck the boxes and then played the recordings back and that is when I got the error. I could see that it used "True" as the value for a checkmark. I also tried doing the GetCellData as you suggested and when I printed out that value it was "True" or "-1" if I told it to print as a number.