Micro Focus QTP (UFT) Forums

Full Version: prob with WebElement object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my application there is a link which is of WebElement class and to my knowledge i read WebElement class objects cannot be recorded so i have to specify the object by its properties to apply method on it ofcoz i need to apply click method on it. But there are 5 links of the same class and having all the properties set similarly,so when i am running the test i get an error like it is not able to identify the object as there are several object with similar object properties (text/Run).
Even i tried the scipt like creating an object and adding fields like name and index but still its not working...Sad
so plz help me out........
index will be unique use that property

regards
Kishore
[quote=kishoreinchennai]
No, it does not have index property, and so its not able to identify.
please help me/....
Hi, swarnavure
Can you give code how you tried to use index?
Also, attached screenshots of ObjectSpy for this WebElement and HTML code of these links could be useful. So maybe I will help you
Hi ,

I am not sure if this will help , but I had some issues with Webelements as well .
Try this :

1.
Code:
Webelement( "innertext:= whatever name " , "index:= 0 ")


whatever name is the actual name of the webelement on the page

2. You could also try to include the webelement in your OR and then include it in your script. Then the Click will work on that Webelement

Hope this helps, Sonia