Posts: 8
Threads: 4
Joined: Apr 2010
Reputation:
0
05-13-2010, 07:12 PM
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.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
05-14-2010, 08:02 AM
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 !!!
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 8
Threads: 4
Joined: Apr 2010
Reputation:
0
05-14-2010, 11:06 AM
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.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
05-14-2010, 12:40 PM
aye aye sir
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
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".
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
05-17-2010, 08:10 AM
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.