Micro Focus QTP (UFT) Forums

Full Version: LookUp grid
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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
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
Hi Saket,

Thank You verymuch for the help. It worked well.

Thanks again.

Swetha