Micro Focus QTP (UFT) Forums
How to get a index value of the webelement in runtime - 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: How to get a index value of the webelement in runtime (/Thread-How-to-get-a-index-value-of-the-webelement-in-runtime)



How to get a index value of the webelement in runtime - silpavinod - 12-07-2012

Hi All,

I am having a webtable inside a webtable i am having an webelement.

how to get the index of that webelement in runtime. The index is changing every time so i want get it in runtime.


Please help me


Thanks in advance,
Silpa.K


RE: How to get a index value of the webelement in runtime - Ankesh - 12-07-2012

Use GetToProperty("index")

Regards,
Ankesh


RE: How to get a index value of the webelement in runtime - udayanem - 12-17-2012

For this, you can use GetRowWithCellText method of WebTable.
Code:
B().P().WT().GetRowWithCellText("Search Text",Column number, StartFrom)

In "Search Text", give the Webelement's Text, so that it will find the Row Number.

Regards,
Uday


RE: How to get a index value of the webelement in runtime - vinod123 - 12-18-2012

Code:
Browser("micclass:=Browser").Page("micclass:=Page").WebElement("name:= name of the webelement").GetROProperty("index")



RE: How to get a index value of the webelement in runtime - sonynaveena - 12-18-2012

Hi
If u have same name for same object
use the concept of Index
for eg: U have sign up link in starting of an Inbox page and at the end of inbox page
then use index 0 for first and index 1 as for second sign up link.
I hope u got that