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

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:

Parents
  •  

     

    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.

  • 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.

     

     

  • 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!

  • 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...

  • Thinking it may be a windows security update I uninstalled all updates within the past 4 days. Restarted and it made no difference.

     

    Additional info in case anyone sees anything suspicious here:

     

    windows 7 64Bit Pro

    QTP 10.00.0.0 build 513

     

    Path environment variable

    ends with C:\Program Files (x86)\Java\jre1.6.0_26\bin; no other java or QTP references.

     

    Java -version info

    --------------------------------------------------------------------------------------------------------------------

    Microsoft Windows [Version 6.1.7601]

    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

     

    C:\Users\profile>java -version

    Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook

    Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP\QUICKT~1\ bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar

    java version "1.6.0_26"

    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)

    -------------------------------------------------------------------------------------------------------------------

     

     

  • Thinking it may be a windows security update I uninstalled all updates within the past 4 days. Restarted and it made no difference.

     

    Additional info in case anyone sees anything suspicious here:

     

    windows 7 64Bit Pro

    QTP 10.00.0.0 build 513

     

    Path environment variable

    ends with C:\Program Files (x86)\Java\jre1.6.0_26\bin; no other java or QTP references.

     

    Java -version info

    --------------------------------------------------------------------------------------------------------------------

    Microsoft Windows [Version 6.1.7601]

    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

     

    C:\Users\profile>java -version

    Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook

    Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP\QUICKT~1\ bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar

    java version "1.6.0_26"

    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)

    -------------------------------------------------------------------------------------------------------------------

     

     

  • Thinking it may be a windows security update I uninstalled all updates within the past 4 days. Restarted and it made no difference.

     

    Additional info in case anyone sees anything suspicious here:

     

    windows 7 64Bit Pro

    QTP 10.00.0.0 build 513

     

    Path environment variable

    ends with C:\Program Files (x86)\Java\jre1.6.0_26\bin; no other java or QTP references.

     

    Java -version info

    --------------------------------------------------------------------------------------------------------------------

    Microsoft Windows [Version 6.1.7601]

    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

     

    C:\Users\profile>java -version

    Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook

    Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP\QUICKT~1\ bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar

    java version "1.6.0_26"

    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)

    -------------------------------------------------------------------------------------------------------------------

     

     

  • Verified Answer

    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

  • Verified Answer

    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

  • Verified Answer

    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

  • The above fix looks like it has done the trick, I have not had any issues with the javawindow class. Now what bugs me is why does the documentation and the qtp install both have the java option reversed? and if I really did have to switch them for it to work correctly then why did it work at all in the first place? In any event it looks like I am all set.

     

    Hope this saves someone some time in the future!

  • Upgraded to QTP 11, and had the same issue as above again. Checked the environment vars and saw they were wrong again so had to redo my fix. Restarted qtp and java is working.

Reply Children
  • I am also facing the similar kind of issue. Mine is a windows based application (Developed on Java) running with UFT 12.02 version and having with java Add-in.

    I launches my Virtual Machine from the Citrix Environment and my VM runs on Windows 7 OS. So whoever access that Vm will have the same set of rules.

    Issue: When I login into the VM, all objects are spying as window but where as all other users, objects are showing up as Javawindow, JavaWinTree etc.

    Please share your thoughts on this issue...TIA