views:

1963

answers:

5

Hi,

We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.

Ideally we want to get QTP to understand that this object is a grid and treat it as one.

Any help would be greatly appreciated.

Thanks

Jon

+1  A: 

What vendor?

I have a few suggestions:

  1. Use key strokes to navigate the grid, rather than mouse clicks. Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around. Use Enter keystroke to simulate double clicking. Often you can use Ctrl-A, Ctrl-C to copy the contents of the grid to the system clipboard, and use the clipboard API to retrieve the data.
  2. You may be able to programmatically get/set the grid properties using the .Object property. .Object provides access to the underlying native properties and methods of the object, as opposed to the QTP methods and properties. You could do something like the following pseudo-code to set focus to a cell and change the value. Your code would differ depending on the vendor implementation. Consult the vendor's documentation to find out what methods and properties you would be able to use.

    WinObject("mygrid").Object.CurRow = 1

    WinObject("mygrid").Object.CurCol = 1

    WinObject("mygrid").Object.Value = "my new value"

Tom E
A: 

If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.

John Dibling
A: 

Same thing for Infragistics. They have a plug-in for QTP for the UltraWinGrid etc.

http://www.infragistics.com/dotnet/testadvantage.aspx#Overview

MatthieuF
A: 

It is resonable to send the request to Support Center. If they will get a big number of requests - they will add support for your grid-vendor.

kj
A: 

May be you forgot to load (install) AddIn for your grid-vendor.

kj