Micro Focus QTP (UFT) Forums
To click on the Link in a webtable - 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: To click on the Link in a webtable (/Thread-To-click-on-the-Link-in-a-webtable)



To click on the Link in a webtable - SweetyChowdhury - 12-21-2009

Hi All,

The scenario is like I need to select a value from dropdown and dependinh on the selection the number od rows in the webtable changes. Example for "value1" in combobox,the number of rows dispalyed is 3, in that table i need to select a link. similarly for second slection "value2",the number of rows changes again.

I tried adding the webtable in the object repository. since the webtable is changing everytime so it is not recognizing it.It is doing only for the scenario it has been added.

Please help how to proceed in this case.


RE: To click on the Link in a webtable - manabh - 12-21-2009

Try out some descriptive programming. Make a object of the link with expected properties & locate on page & proceed the work.


RE: To click on the Link in a webtable - upadhyay40 - 12-22-2009

Hi sweety,

You can use descriptive programming, and for getting total row count u use "Items count" in GetROProperty and according to that you just use a For loop till Items count and get the third row by Indexing
For ex:Code look like
Code:
Set obj = Description.create()
..
set count = Browse.("x").page.("x").weblist(x).getroproperty("Items count")
For i = 0 to count-1
if i = 3
Browse.("x").page.("x").weblist(x).select ("#") & i
end if
Next

Hope this will help you to solve your problem, please let me know if you need some information.

Thanks
Mahesh


RE: To click on the Link in a webtable - nil - 12-23-2009

Hi sweety,

pls ans some below questions.
what do u mean by "since the webtable is changing everytime so it is not recognizing it"
changing which property,

what is the Text of the link you want to click,

->you can create an discriptive object of the link and directly find it in webtable abd below syntax
browser(--).page().fram().webTable().link(your descriptive object).Exists
no need to use an for loop to locate it.

Thanks