Micro Focus QTP (UFT) Forums
Not able to find the Link Object. - 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: Not able to find the Link Object. (/Thread-Not-able-to-find-the-Link-Object)



Not able to find the Link Object. - shivaprasad.tbt - 05-13-2010

I have recorded a click action for a link whos name(Alphaneumaric) changes randomly. So every time i run the test, it gives the error as below.

"Cannot identify the object "bdacb9079e" (of class Link). Verify that this object's properties match an object currently displayed in your application."

So How to record this varying link on which i have to record click action?

Please help am a beginner for QTP.


RE: Not able to find the Link Object. - basanth27 - 05-14-2010

Next time please paste the code you have been trying. That way it is easier to correct and reply back. The reason you are facing the error is because,

There is a link which you have stored with certain properties. these properties are static. However, during runtime the link could change due to various actions and hence the properties would change too. This brings us to deal with dynamic properties.

A concept called Regular expression is a powerful term used to deal with such scenarios. What you do is find a particular property which remains constant across all the links if text is appended or removed. Basically if you have links with properties like,

1. name:= LearnQTP
2. name:= LearnQTPagain
3. name:= LearnQTPandQTP

So if i want to identify all the links with a single line of code then i will use regular expression. Here is how i would do it,

Learn.* - It means ignore everything after *. Remember the word "Learn" is a constant in all the three properties. This way QTP will know that you have told it to look for a link with the name Learn and hence your script will go through.

As a beginner, i understand it is very tough to get to know everything. Pressure at work coupled with the urgency to get the task done pushes every individual to take the most shortest route. However, i suggest, the shortest route to get the answer is always to first search for similar posts, read through and maybe or probably you will find the answer before somebody answers it.

Good Luck with the learning mate !!!


RE: Not able to find the Link Object. - shivaprasad.tbt - 05-14-2010

First of all thanks a lot for your reply Basanth. Support from people like you make life easy for beginners like me.

Actually when i recorded, i had a link named "bdacb9079e". and when i ran my test, the link changed to "cdodd349ef". so what would be the regular expression to pass if i have all 10 characters variable and where. Right now i am passing Reg Exp for text of the object.

Thanks again.


RE: Not able to find the Link Object. - basanth27 - 05-14-2010

aye aye sir Smile

Well, if thats the case, and you want to identify the link using the codes( cdodd349ef ) then here are a few questions,
1. Is these codes static or dynamic ? Meaning, all through your regression does this data remain same ?
2. Is this code a critical property for identification ? I mean, without specifying it does it recgonise the link ? If it does then you can use a property called "getroproperty" and then retrieve this code. However, i dont think thats your purpose.
3. Nothing at the top of my head now Smile answer the above and we will proceed further..

Cheers mate !! I like people who are intrested to "take wisdom,apply it and then give it back downstream".


RE: Not able to find the Link Object. - shivaprasad.tbt - 05-17-2010

ok.. Smile

Yes.. the link(cdodd349ef) is dynamic and its a critical property for identification.


RE: Not able to find the Link Object. - basanth27 - 05-17-2010

Check the index property for the webelement and see if that helps. Then with the list of available codes you have, click if the code matches else log the error.