Micro Focus QTP (UFT) Forums
Help about the DataGrid object - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Help about the DataGrid object (/Thread-Help-about-the-DataGrid-object)



Help about the DataGrid object - vimal_selvam - 08-26-2009

I am using QTP9.0 version. I am trying to select a particular row from the datagrid. But the problem is, QTP identifies the datagrid as a single object GXWND. But it is not identifying the rows or columns in that datagrid. Please find the screenshot of that Data Grid.
And I tried the following code to select a particular row:

Code:
l = Window("Product").Window("Product Selection").WinObject("GXWND").GetROProperty("x")
b = Window("Product").Window("Product Selection").WinObject("GXWND").GetROProperty("y")
r = Window("Product").Window("Product Selection").WinObject("GXWND").GetROProperty("width")
t = Window("Product").Window("Product Selection").WinObject("GXWND").GetROProperty("height")
x = (l+r)/2
y = (b+t)/2
Window("Product").Window("Product Selection").WinObject("GXWND").Click x, y
This helps to select a particular row in x & y co-ordinates. But i want to select a defined Product Alias Name which is in Data Table and to select that value, we have to scroll down the datagrid. Please help me for this issue.


RE: Help about the DataGrid object - basanth27 - 08-26-2009

1. Can you attach a spyshot of the object ??

Winobject indicates it is a custom object. Was there any third party tool used by dev to build these objects ??

On what platform is this object built on ?? Is this a .Net or windows or web ?


RE: Help about the DataGrid object - vimal_selvam - 08-26-2009

Hi Basanth,

I am very new to QTP. And I don't know about the SpyObject and dont know in which platform, the Dev team build it. Thanks for your quick reply.


RE: Help about the DataGrid object - basanth27 - 08-26-2009

Okay. No Problem. Lets take it step by step.

1. On your QTP window, Navigate to Tools-> Object Spy.
2.On the object spy click on the pointing Hand and then move the pointer to the Datagrid and click on it.
3. On the Object Spy you will find that it will capture the objects properties and display them.
4. Drag and enlarge the spy and take a screenshot of it and upload it here.

If you have access to a developer who is working on this part of the application, Please ask him the below questions.

1. What kind of a Technical object is the Datagrid ??
2. How was this object developed ?
3. How are you setting the Rows & column data in the datagrid ?

Find the answers and we will move to the next step.


RE: Help about the DataGrid object - vimal_selvam - 08-26-2009

Please find the snap shot of the Object Spy below.
And for the platform query, it must be a Windows platform. But am not sure. Because, the dev team only customizing the application.


RE: Help about the DataGrid object - basanth27 - 08-26-2009

Can you see if you have a method called Gettextlocation exist for the winobject ?

Try the below and let me know what do you get on the screen,
Code:
rowcount = Window("Product").Window("Product Selection").WinObject("GXWND").Object.Rows.Count
msgbox rowcount

itemscount = Window("Product").Window("Product Selection").WinObject("GXWND").Object.Items.Count
msgbox itemscount