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:

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

  • 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

  • Hi, I am facing similar issue with UFT 12.52. I am having JAVA 1.7.0.25 in the PC.  My application is launched from web browser. I have few steps that opens Java application. But when I am trying to  Identify objects i am just getting windows objects and not actual java objects. I have java addin installed as well.   Do I need to set env vars as system Variables or User variables? Does Jre version makes any different? Is Java 1.7.25 is supported with UFT 12.52? Thanks

  • Hi,

     

    Could you please explain me the procedure, how we  can create bat file, as I am also facing the same issue

    Thanks

    Kandula