Jon
Jon

Reputation:

Mercury Quick Test Pro - Testing with a custom grid

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

Upvotes: 0

Views: 4000

Answers (5)

kj
kj

Reputation:

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

Upvotes: 0

kj
kj

Reputation:

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.

Upvotes: 0

Matthew Farwell
Matthew Farwell

Reputation: 61695

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

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

Upvotes: 0

John Dibling
John Dibling

Reputation: 101456

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

Upvotes: 0

Tom E
Tom E

Reputation: 2482

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"

Upvotes: 1

Related Questions