BUG: "Fail to instrument..." in Java app on new windows

Bug reports.
krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

BUG: "Fail to instrument..." in Java app on new windows

Post by krstcs » Tue Jun 10, 2014 8:06 pm

Ranorex 5.0.3
Windows 7
Java 1.6.0_45

Intermittent Ranorex warnings on new Java windows/forms:
"Failed to instrument Java process. Please make sure you have enough privileges to access the process.
(This message is only shown once per report.)"

1. This app is running as administrator and Ranorex is running as administrator.
2. This happens at various points and various windows, sometimes on the initial start-up, sometimes well into the application.
3. The windows are valid and the test continues without error so the objects are being found.

I run the same test 3 times in a row (3 different stores on our POS) and when it happens it only happens in one of them, not all of them. It appears to be mainly on Validate steps, but I'm not sure about that.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by Support Team » Mon Jun 16, 2014 3:49 pm

Hello Kelly,

May I ask if it’s somehow possible to grant us access to your Java application?
Thank you in advance.

Regards,
Robert

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by krstcs » Mon Jun 16, 2014 4:01 pm

Unfortunately, no, it is not possible. The application requires domain credentials and access.

I would offer a web-meeting, but since I cannot predict when or if this will occur it might be a waste of our time.

It appears to be related to the new method of Java instrumentation. Our application creates new instances of the JVM for several windows when it creates the windows. So, there are new top-level /form objects for each of the windows, and new java instances for each one. It seems that the Ranorex instrumentation is taking too long to initialize sometimes so Ranorex continues the test before the JVM injection is fully complete on the new JVM instance.
Shortcuts usually aren't...

Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by Mayra » Thu Aug 07, 2014 10:00 pm

I have a web start application and I am experiencing the same issue.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by krstcs » Fri Aug 08, 2014 1:30 pm

Mayra, what version of Ranorex are you using?
Shortcuts usually aren't...

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by krstcs » Mon Aug 25, 2014 4:34 pm

Update:

I believe that this issue is a result of using a JNLP to start the Java application. If I open the JNLP link and then attempt to wait for the resulting Java form to exist, I get the "Failed to instrument..." warning. It appears that Ranorex attempts to start the Java plugin before java is actually fully started, so it fails, when in reality, the plugin is working, but Ranorex now can't connect to it because it disposed of the handle after the error.

If I put a static DELAY(30s) in my test after starting the JNLP, but before attempting any actions on any Java elements, I don't get the error.

While this work-around works most of the time, there are times when the JNLP takes longer than 30s to load, which means my test will have the warning, and then will not work after that in many instances.

I am working on a small JNLP-based Java app that will demonstrate the issue. I will post it when I get it working.
Shortcuts usually aren't...

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by krstcs » Mon Aug 25, 2014 6:26 pm

OK, I have a project that demonstrates the issue. However, I am sending both the Java project (NetBeans, but it should work anywhere) and the Ranorex solution via email so there are no security issues.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: "Fail to instrument..." in Java app on new windows

Post by Support Team » Wed Aug 27, 2014 12:42 pm

Hello krstcs,

Thank you for providing the example.

It is indeed an issue and will be resolved within one of our next releases. Thank you for your patience.

Regards,
Robert