Micro Focus QTP (UFT) Forums
GetRowwithCellText(dataTable.Value()) - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: GetRowwithCellText(dataTable.Value()) (/Thread-GetRowwithCellText-dataTable-Value)



GetRowwithCellText(dataTable.Value()) - uma87 - 07-29-2011

hi, can anyone help me with the below code...

Code:
Set oDesc = Description.Create
oDesc("micclass").value= Link
temp=DataTable.Value("A", dtGlobalSheet)
row=Browser("XYZ").Page(ABC").WebTable("MNO").GetRowWithCellText(temp,1,1)
set Link =Browser("XYZ").Page(ABC").WebTable("MNO").childItems(row,1,"Link",0)
Link.click

Running this code, i get either "object required" error or "invalid aruguments" passed error on Set link line.
my datatable has a integer value. Can GetRowWithCellText and Datatabale value go together?

scenario of the script is , I create a request and capture the request number say 005 in datatable. on a different web page, i open a web table which shows me the created requests. I need to click the link against the request 005. the web table has 5 coloumns and link to be clicked is in last coloumn
eg:
request decsription date Price
001 .... .... 100 Link
002 ... .... 100 Link
and so on..
so for every new request created a new row gets added in web table with the request number, i need to select that newely created request.
i tried using above script but it isnt working as expected...


RE: GetRowwithCellText(dataTable.Value()) - rajpes - 07-29-2011

ChildItems is not a valid method.
Change it to ChildItem

Still if it shows "object required" error, it means there is no "Link" object at that row, column position!


RE: GetRowwithCellText(dataTable.Value()) - uma87 - 08-01-2011

I corrected to ChildItem.
I modified the code a bit which worked for me Smile

Code:
Ref = Trim(DataTable("A", dtGlobalSheet))
LinkText = "LINK"
row = Browser("").Page("").WebTable("").GetRowWithCellText(A,1,1)
A = Cint(row)
CCell = Browser("").Page("").WebTable("").GetCellData(A,5)
Set objLink = Browser("").Page("").WebTable("").ChildItem(A, 5, "Link", 0)
Wait("3")
objLink.Click

Thank you for immediate reply.


RE: GetRowwithCellText(dataTable.Value()) - rajpes - 08-02-2011

that's good


RE: GetRowwithCellText(dataTable.Value()) - nikhilcogni - 06-16-2012

Even I'm having a prob

Hi I was trying to click a link in a webtable. Link is present in 3 column and 2nd row. I'm using childitem and getrowwithcelltext

code is :

Code:
row=browser().Page().webtable().getRowWithCellText("Price",3,1)
set link=browser().Page().webtable().childitem(row,3,"Link",0)

but qtp throws error for 2nd line and says general error. Wrong number of arguments has been pased or invalid property assignment.

Can somebody tell whats wrong there[/align]


RE: GetRowwithCellText(dataTable.Value()) - himabindhub - 08-30-2012

Hi,
remove parenthesis and try it.

code is
Code:
row=browser().Page().webtable().getRowWithCellText "Price",3,1
set link=browser().Page().webtable().childitem row,3,"Link",0