Forum Discussion
Hi,
I have dealt with this issue before with several different grid controls. Two approaches have worked for me.
Approach number one only works if you can manually select individual cells, or groups of cells, using your mouse. It also requires that you are able to move through the cells using arrow keys on the keyboard. Lastly, you must have the ability to copy the cell contents to the clipboard. So the sequence would go something like this if for instance you wanted to verify the value in row 2, column 2 using a script:
- Click in the top left corner of the grid to select cell 1,1, or the column header if it has one, <grid control object>.Click 5, 5
- Send keystrokes to move to the target cell <grid control object>.Keys("[Right][Down]")
- Copy the cell contents to the clipboard using keystrokes <grid control object>.Keys("^c")
- Verify the value with a clipboard checkpoint: Clipboard Checkpoints | TestComplete Documentation (smartbear.com)
Provided the grid responds to keystrokes you can select and verify multiple contiguous cells by using the Shift key in combination with the arrow keys.
If you can't work with the grid control in the manner described above, then approach number two may be your best option. That approach uses the IQ Add-in to recognize the table and provide access to the cells. The downside of that approach is the extra expense of the IQ Add-in and requirement that all your test environments have external internet access.
Here is a link to the help topic for using that method: OCRTable Object | TestComplete Documentation (smartbear.com)
Best regards,
John
Related Content
- 11 months ago
- 4 years ago
- 3 years ago
- 5 years ago
Recent Discussions
- 14 hours ago
- 2 days ago