BUG: java.lang.reflect.InvocationTargetException halts test

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

BUG: java.lang.reflect.InvocationTargetException halts test

Post by krstcs » Tue Aug 05, 2014 3:14 pm

Ranorex 5.1.1
Windows 7
Java 6u45/7u60

Getting the following error when attempting to find a row in a Java table. This appears to have just started today, it was working fine yesterday. This only happens with Ranorex, the AUT works fine otherwise.

After this the test hangs indefinitely and must be stopped manually by killing the process (Pause does not work). This happens every time the test is run.

Code: Select all

Getting attribute 'name' failed on FlavorElement with flavor 'java'. java.lang.reflect.InvocationTargetException 
Show/Hide Stacktrace
  Ranorex.RanorexException: java.lang.reflect.InvocationTargetException 
  Ranorex.Plugin.JavaObjectWrapper.InvokeGetPropertiesAndMethods() +0x3a 
  Ranorex.Plugin.JavaObjectWrapper.EnsureAccessorCacheFilled() +0x40 
  Ranorex.Plugin.JavaObjectWrapper.GetProperty(String name) +0x0 
  Ranorex.Plugin.JavaObjectWrapper.GetPropertyCascaded(String name) +0x56 
  Ranorex.Plugin.JavaCellFlavorElement.GetAttributeValue(Element element,String name) +0xb5 
  Ranorex.Core.Element.GetAttributeValue(String name) +0x164 
This exact test (and specifically the module) worked fine yesterday, so I know it isn't the script or the data.


*I will not be able to provide the application or the code/paths for this one due to restrictions.
Shortcuts usually aren't...

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

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by krstcs » Tue Aug 05, 2014 3:49 pm

OK, a little more info.

This test worked on a newer version of our software yesterday. The older version I ran on this morning does not have the attribute that the RanoreXPath was looking for, so that was my bad. :D

However, I think this is a bug in Ranorex, as the system should not hang if the attribute is not found, it should timeout correctly and fail the test.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by Support Team » Wed Aug 06, 2014 1:20 pm

Hi krstcs,

Thank you for reporting the issue. I tried to reproduce it but in my case the action on an element with an invalid attribute in the RanoreXPath timed out as it should. Can you explain what exactly you did in order to get the behavior?
Thank you.

Regards,
Bernhard
.
Image

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

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by krstcs » Wed Aug 06, 2014 1:37 pm

I have a complex path statement such as (this is simplified and generalized):

Code: Select all

App -> /form[@processname='Java' and @WindowText='MyJavaApp']
  AppContainer -> /container (Rooted folder)
    Table -> /container/container/container/table (Rooted folder)
      Row -> /row/cell[@name=$Name]/parent::row/cell[@text~$TextInfo]/parent::row/cell[@text=$EmailAddress]/parent::row (Rooted folder)
All I do is attempt to double-click on the row object with Mouse->DoubleClick->Left->CenterLeft->Row. The module hangs after searching for about 80% of the total timeout and throws the exception.

Again, I simplified the path above because of protected info, and my actual path works on the newer version of our software, so I know that pathing is fine.

Also, I went through the steps to manually remove the old Java plugins Monday, using the Instrumentation Wizard with the special Java switch. I doubt that is the issue, but thought I would bring it up.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by Support Team » Wed Aug 06, 2014 3:07 pm

Hi krstcs,

Am I right that the name attribute didn't exists for the java table element when the exception was thrown? If yes, it should be possible just to change the name of the attribute within the repository and the issue should also appear.

I tried this, but as I said I didn't get the exception.
JavaTableRecording.jpg
JavaTableRecording.jpg (120.39 KiB) Viewed 1439 times
Maybe I did something wrong.

Regards,
Bernhard
.
Image

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

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by krstcs » Wed Aug 06, 2014 3:25 pm

Actually, when I edit the path with Spy, the first cell is found, but the second is not. I think this is where the problem is.

The first cell has the Name attribute in all versions, but the second and subsequent cells do not have a text element in the old version.

Spy doesn't find the other cells, but it doesn't throw an exception. The exception is only thrown at run-time in a test.

Also, the row needs to be a rooted folder with the complex path that I noted earlier. I have to use several cells in each row to identify the correct row. The rooted folder then contains items for each cell for use in other capacities.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: BUG: java.lang.reflect.InvocationTargetException halts test

Post by Support Team » Fri Aug 08, 2014 3:07 pm

Hi krstcs,

Thank you for providing us additional information.

We will try to reproduce the issue with this information and I'll get back to you as soon as I have any news.

Regards,

Markus (S)
.
Image