Highlighted
Absent Member.
Absent Member.
8761 views

Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Hello, I am having a problem where any java application is being seen as a window class object. Meaning that no objects in the app can be seen by QTP. This probelm just started this morning so I know the java addin and application were configured correctly. Yesterday I was coding allong just fine, I can't imagine what would have changed over night. java or windows update maybe? I have went as far as to uninstall and reinstall qtp with no affect.  Any advise?

 

Thanks

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Ok, I think I have it (although I have thought I've had it a couple times now...), I noticed on my last post that JAVA_OPTIONS varialbes looked like the paths are reversed. So I went through all of the java environment variables and switched them.

 

originally: (this is also what is documented in the qtp help file...)

_JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:<classes folder path>;<classes folder path>jasmine.jar

 

changed it to :

_JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:<classes folder path>jasmine.jar;<classes folder path>

 

I did this with _JAVA_OPTIONS and IBM_JAVA_OPTIONS under both user and system variables

 

After I did that I was trying to get the java console to come up so I could verify that the app was loading with the qtp hooks. While trying to do that I opened a command prompt and went to "C:\Program Files (x86)\Java\jre1.6.0_26\bin" then ran my java file from that directory.  I never did get the console to give me confirmation but for the hell of it I tried to object spy the window, JAVAWINDOW class! closed outy of both the java app and qtp started them up again, WINDOW class? opened up the file again through cmd in the java bin directory, JAVAWINDOW! rebooted and tried again, JAVAWINDOW, and rebooted one more time for fun, JAVAWINDOW!

 

I went to my other computer changed the environment variables like above, launched the java app with cmd in the java bin folder... JAVAWINDOW!

 

I tried to put the java bin folder back in the Path environment variable but it didnt make a difference, it looks like for whatever reason that unless I launch the java app from within the scope of the java bin folder QTP cant see it.

 

So I made a quick bat file to launch the java app from the bin folder and I have QTP launching that instead of the java app directly and all is good.

 

...Finally

View solution in original post

18 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

 

 

1. Check the system environment variables from %path%. Is any external java installation path is pointed? If that so, comment and try

2. Check that jasmine.jar(QTP Java loader) in the test environment variable.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Hi, thanks. I figured out what it was, it looks like qtp 10 is incompatible with jre 1.6.35, which was what my local install was at. Or maybe a better way to say it is that, in my setup at least, it is compatible with 1.6.25. When it was working on Monday I had jre 1.6.25. It must have updated on me. I simply uninstalled .35 and reinstalled .25 and I am able to pick up the javawindow class. And hey it only took me a day and a half of hair pulling to figure it out! I guess the good part is that now I know QTP inside and out! lol

 

Thanks again your comment made me think of the jre version as being an issue.

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

FYI, I also had to set the jre 1.6.25 install directory into the path environment variable.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Never mind Its not working again. Checked jre version and im still at 1.6.26 and my environment variables are set correctly. Was working great yesterday, go to test some new code and all I can see is the window class again. I am really starting to dislike QTP. it seems like I spend the first half of everyday fixing this java issue just to have it happen the next morning. Anyone have any Idea why this is happening?

 

Thanks

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Interesting piece of info, its not all java apps. I have another java app and qtp can see the object in that just fine. So why would QTP be able to see java object is one app but not the other? I know QTP has the capability to see the objects because I get it working after messing around with stuff for half the day.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

ok so uninstall jre 1.6.26, reinstall it it works fine? so now I have a temp fix for it so i can at least move forward but reinstalling java every morning is not a long term solution.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Just to make sure this was repeatable I shut down the computer and started back up, java app only seen as window class again. uninstall jre reinstall it and as long as I don't shutdown it sees javawindow class again. Anyone know if there is a hotfix for QTP 10 for this?

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

I don't know! This time without restarting the computer or shutting down, just closing the java app and starting the app again and QTP doesn't see javawindow class. I reinstall java...again. and still can't see it. Restart the computer and reinstall java... Still can't see it. Shut down, power up and reinstall java... Still can't see it.  Something has to be triggered the first time a java app is launched that messes with QTP java hooks... This is ridiculous...

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

Monday morning, same boat... Does it maybe have something to do with 64 bit windows and QTP10? or a combination of those and jre1.6.25? Tried it on another 32bit windows 7 desktop with the same results.... What really sucks is that I have the entire test coded but can't complete testing since I cant get QTP to see the application anymore, and testing with QTP is required for this project... This is so frustrating! I don't think I will ever take another project that requires QTP.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

So another whole day lost... tried a bunch of different versions of java with no working combination. Talked with another guy that says his install is working fine with this java app, he has no java references in his path environment variable. So I remove mine, rebooted but could not get it to work. He said he did nothing special, just had java installed then installed QTP and thats it. So I decided to try a complete fresh install. Removed all java and QTP. On reinstalling I ran into an issue with it hanging on something with the assembly. after some research I found that it was due to a mercury dll that was never removed on the previous uninstall (Not sure if this is a red falg to someone). So I was able to remove that and then ran the QTPCleanUninstallerV2.10 to make sure there were no reminants of the old install. Since I read that they sometimes cause issues. rebooted one more time for fun... Installed java 1.6.0_26, rebooted...then installed QTP 10 with the java optional addin. restarted then brough up qtp then my java app and still only see the java app as the window class. W....T.....F.....

 

I have to get this working so I will post an update on what doesnt work tomorrow!

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Object Spy sees a java app as window class instead of javawindow class?

Jump to solution

The thing I really dont get is why just reinstalling java worked for a few days? Just tried it again and it still wont work. Does anyone have a complete list of what all reg keys, files, windows settings, ect should be in place for java to work? Should the java path be in the path environment variable? earlier on it would not work for me until I put it in manually... I also see people saysing it sould not be there? any suggestions?... At this point I would even consider a format reinstall...

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.