Posts: 5
Threads: 2
Joined: Jan 2008
Reputation:
0
08-19-2009, 05:32 AM
Hi Ankur,
I am testing Java Application and for the first time I am under such tough situation.Let me explain you the scenario.
The application that I am testing has Java List and I have to run the test for 5 iterations.The properties in the Object Repository are
1. Class Description - list
2. attached text - Available.*
So when QTP runs for the first iteration the list has 4 values and QTP has no problem identifying the Java List. Now second time the List has 2 values and QTP denies to recognise it. I used GetTOProperties and found that for first iteration it uses the object from repository & takes attached text as Available.*" . Next time it takes the attached text as Available - 4". I tried with descriptive programming too but didn't help.
I have been running the same scripts for almost 1.5 yrs and it had no problem and all of sudden from last couple of builds QTP is throwing error "The object can't be identified.....".
I hope i have made myself clear.
Please help me to understand why QTP is not picking the properties from rep...
Waiting for your reply.
Thanks
Posts: 516
Threads: 17
Joined: Jul 2009
Reputation:
3
08-19-2009, 11:07 AM
Hi aditi,
It's suprising how the property value is changing in OR. Anyhow, here i can provide one work around i.e. use the SetTOProperty and set the property value to "Available.*" in OR.
Please let me know the status and for any other info.
Thanks,
SUpputuri
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-19-2009, 11:31 AM
Try adding the object again and make the changes..Does that help ?
Which version of QTP are you using ?? Does this happen on all the machines you execute ?
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: 5
Threads: 2
Joined: Jan 2008
Reputation:
0
08-19-2009, 10:35 PM
Hi
The same code/script is on two different machines. The server/machine where the scripts runs has problem but the machine where i develop my code does not have any problem. The script runs fine on my machine.Also I tried deleting the object and re-adding it. I tries adding different set of But it didn't help. I am using QTP 9.2.
Also for my clarification I added GetTOPorperties in my code. As I already mentioned the attached text in the object repository is Available.*.
So my question is when QTP runs for the first time, I noticed that it takes the two properties to identify the object which is JavaList in our case.
to_class=JavaList
Attached Text = Available.*
The list has 4 items. So should it be taking the attached text as Available - 4 or Available.*. Please clarify.
And next time when it runs the list has just 2 items and QTP is taking three properties to identify it.The properties are:
to_class= JavaList
class description = list
Attached Text = Available - 4
What is the difference in between "to_class" & "class description"? The application that I am testing is Java Application so why it shows the value as list ?
Appreciate your help.
Thanks
Aditi
Posts: 5
Threads: 2
Joined: Jan 2008
Reputation:
0
08-19-2009, 11:52 PM
Hello QTPKing,
Thanks a lot for your instance reply.
As per your instructions, I added the SetToProperty in my code. The value is already "Available.*" in OR. So with the help of GetTOProperties what I found was it does take the value as Available.* but still when it comes to recognize the object, QTP throws the error "Can't identify the object "List_Available" (of class JavaList).Verify that this object's properties match an object currently displayed in your application."
And the interesting fact is when I try to HIGHLIGHT the object from Object repository, it does show the correct Java list.
I am trying my best to nill down this issue. But any ideas/solutions would be highly appreciated.
Thanks
Aditi
Posts: 516
Threads: 17
Joined: Jul 2009
Reputation:
3
08-20-2009, 10:22 AM
Hi aditi,
Please run the "QuickTestProfessional.bat" file located in the "C:\Program Files\Mercury Interactive\QuickTest Professional\bin" and then try again. Let's hope this will solve your issue.
Thanks,
SUpputuri
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-20-2009, 10:30 AM
Yeah Probably it would. Just adding my 2 cents,
Aditi -
I guess the issue is with object refresh. Either the script sync is out or the list is there but QTP is too quick to select before the objects are loaded. The matter of fact that this script had no issues for 1.5 years only rings the bell about performance of the application. If QTPKing's above solution does not resolve the issue, please try this,
After it is done with selecting the javalist with 4 items write the below code,
Code:
wait 2
Javalist().Object.Refreshobject ( or ) JavaList().Refreshobject
javalist().Click
javalist().select "whatever"
Let me know if this helps.
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: 5
Threads: 2
Joined: Jan 2008
Reputation:
0
08-21-2009, 04:17 AM
Hi Basanth/QTPKing
I tried all the solutions provided by both of you. But unfortunately neither of them helped.
Basanth- The code "Javalist().Object.Refreshobject ( or ) JavaList().Refreshobject" didn't work for me for some reason.
But anyways the only final option that was left for me was to un-install QTP and then re-install it. So i did un/re-install and guess what --- It started working...Hurray!!!
Thank you very much for your kind & prompt reply.
Regards,
Aditi