UFT2023_Not able to Identify JAVA application

Hi Team,

Not able to Identify JAVA application using object spy, it is identifying as window object.

when i record on JAVA application able to generate the script as below.

JavaWindow("X").JavaDialog("Y").JavaEdit("username").Set "testuser"

rerun of recorded script not identifying java application again.

Please help me what could be the issue..?

Regards,

Parents
  • 0  

    Hi Shashu,

    For UFT One to identify Java objects in Java 16 or later, you must specify the following options when you run your Java applications:

    --add-modules=java.desktop --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt.image=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED

    You can specify these options in one of the following ways: 

    • Include the options in the Java command that you use to run your application.

    • Enter the options in the value of the JDK_JAVA_OPTIONS environment variable. Note that this affects all Java applications that you run on this machine.

    More Details please see UFT one Help Center: Java Add-in (microfocus.com)

     

Reply
  • 0  

    Hi Shashu,

    For UFT One to identify Java objects in Java 16 or later, you must specify the following options when you run your Java applications:

    --add-modules=java.desktop --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt.image=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED

    You can specify these options in one of the following ways: 

    • Include the options in the Java command that you use to run your application.

    • Enter the options in the value of the JDK_JAVA_OPTIONS environment variable. Note that this affects all Java applications that you run on this machine.

    More Details please see UFT one Help Center: Java Add-in (microfocus.com)

     

Children
  • 0 in reply to   

    HI Rosie,

    Thanks for the reply.

    Do i need to create  JDK_JAVA_OPTIONS system environment variable and add below values, can you please help me here to understand..?

    -add-modules=java.desktop --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt.image=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED

    (Or)

    we are using app_start.cmd file to to launch the java application do i need to add in the cmd file in the beginning .?