Micro Focus QTP (UFT) Forums
LookUp grid - 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: LookUp grid (/Thread-LookUp-grid)



LookUp grid - swetha.b - 12-23-2009

Hi All,

Please have a look at my attached screenshot.
This is the grid that pops-up when I click on a lookup image. My requirement is I need to dynamically select any required row(s)[record] through QTP. Below are the challenges I am facing:
1) How do I add this grid to the repository?? is it the webtable I am supposed to add?
2)If yes please let me know how do I select the rquired row(record) and hit save?
3)how do I count number of rows(records) present in the grid?

Please help me in this context.

Thanks
Swetha


RE: LookUp grid - Saket - 12-23-2009

Hi Swetha,

for the answers of your questions
Quote:1) How do I add this grid to the repository?? is it the webtable I am supposed to add?
Yes
Quote:2)If yes please let me know how do I select the rquired row(record) and hit save?
you must be identifying your row with some unique value in the row like property name, if so get the row number using the method 'GetRowwithCelltext', this will return you the row number. once you get that click the webelement of any cell from that row or i think simply the first cell will work. and then click the OK button
Quote:3)how do I count number of rows(records) present in the grid?
use .RowCount

hope this helps


RE: LookUp grid - swetha.b - 12-23-2009

Thanks Saket For the immediate response.
Your answer almost solved my problems. Here is what I have written:
Code:
msgbox mypage.WebTable("PropertyLookup").RowCount
'Displaying the row count
Code:
var=  mypage.WebTable("PropertyLookup").GetRowWithCellText("MANSION HOUSE")
'Displaying the selected row count.

But, how do I make the pointer (in the grid) to point to the specified row[(GetRowWithCellText("MANSION HOUSE")]
?? as I see grid always points to the first record bydeafult.

Thanks again for your response

Swetha


RE: LookUp grid - Saket - 12-23-2009

How do you select it manually? I beleive you just click on the row, right?
if so follow the two step identify the webelement in column 'Property Name' and click on the webelement
Code:
Set objChildItem =mypage.WebTable (("PropertyLookup").ChildItem (var, 2, "WebElement", 0)
objChildItem.Click



RE: LookUp grid - swetha.b - 12-24-2009

Hi Saket,

Thank You verymuch for the help. It worked well.

Thanks again.

Swetha