Just wonderring how to get row object of a table.
as I wanna mimic a row click of table in webpage.
Thanks a lot.
For first Row try this
But this might not work well if you have nested tables inside this table.
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
It didn't work, as webtable does not have webelement method
But :-) Lucky, I found the solution:
Then the row will be selected.
Anyway Thanks a lot for your reply.
Doesn't work for me. [img]/images/graemlins/frown.gif[/img]
For the code "WebTable("...").Object.row(rowNumber).click"
I am getting the error that Object doesn't support this property or method.
I tried "WebTable("...").Object.rows(rowNumber).click" and I am getting error that object required.
I am trying to click on a webelement contained in a row of a webtable. (My aim is to click on a particular row in a webtable)
I tried childItem method of webtable but it doesnt seem to work on webelements.
I used childitem(row,col,"html tag:="TD",0) also.
But again the same error of Object required.
Its automation not automagic
Look at this thread and try to understand how deal with objects inside table.
You are using ChildItem incorrectly. It accepts micclass and not description string. You need to use WebTable with that.
And a error that you see could be because of the the fact there might not be as many rows as you are expecting to have.
I found the solution to this by accident. The same code works if I change the reference cloumn to 0.
So the same code with which I started out works but the only difference is that to click on the desired row the column to be refernced is 0.
Thus, instead of :
this works fine:
As far as I know there is no column 0 for a webtable, the index starts at 1.
I also found out that the web table in my application does not support object clicks.. so only the whole row can be clicked.
This code may be working because I am trying to click on the whole row instead of one item in the row.
Hope this helps some one who is facing a similar problem.
[ QUOTE ]
this works fine:
[/ QUOTE ]
Are you sure this works? I can see a syntax error in that.