Spy says Element is invisible when I can see it.

Ask general questions here.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Spy says Element is invisible when I can see it.

Post by stapes » Mon Nov 09, 2015 2:30 pm

I am running a Test Suite against a Windows Desktop Application.

It opens a particular form to validate an entry in a drop down box exists. This is successful. It Cancels the form and re opens it.
It enters a value in a text box and validates that value.

This says it is successful but it is mistaken. There is no value in the field.

Then, it clicks on the drop down box element to open it, and I get this error:
Failed to move to location 'Center' within element '{CheckBox:PART_DropDownToggle}'.
The pointer cannot be moved to point '{X=-1073741825,Y=-1073741825}' since it is outside of the visible desktop.
When I inspect the element using the Ranorex Spy, it says Element is invisible.

I tried EnsureVisible(). It made no difference.
I tried Focus(). It made no difference.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Spy says Element is invisible when I can see it.

Post by odklizec » Mon Nov 09, 2015 2:40 pm

Hi,

It's hard to suggest something reliable without seeing the snapshot and steps you are performing prior the failure. Could you please post the snapshot and at least screenshot of the recording, where we can see used steps? Ideally, post the entire recording + repository file.

My guess is that you are trying to click a combo box element, which is not actually visible, because the combo box is not expanded? Try to expand the combo, then use EnsureVisible on the combo box element you want to click.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Spy says Element is invisible when I can see it.

Post by stapes » Mon Nov 09, 2015 3:18 pm

I think it has fallen over before it reaches that point.

This is from the log. It has re-opened the form and entered a value in a Text field.

Code: Select all

00:57.318 Info Data  Current variable values:
$varFormName = 'More Testing Form 3'  
00:57.377 Info Invoke Action 

 Invoking EnsureVisible() on item 'Forms_Create_New_Form.Form_Name'.  
00:57.440 Info Invoke Action 

 Invoking Focus() on item 'Forms_Create_New_Form.Form_Name'.  
00:57.505 Info Set Value 

 Setting attribute Text to '$varFormName' on item 'Forms_Create_New_Form.Form_Name'.  
01:50.947 Info User 

Open Snapshot  
01:50.949 Info Validation 

 Validating AttributeEqual (Text=$varFormName) on item 'Forms_Create_New_Form.Form_Name'.  
01:51.023 Success Validation 

 Attribute 'Text' of element for item 'AgilePortalRepository.Forms_Create_New_Form.Form_Name' does match the specified value.  
But look at the screenshot!!
screenshot1.PNG
The log lies - it says it has validated that Form name matches the value, but it is empty!!!

I have taken a snapshot at this point.
AgileTestAutomation_20151109_140756_1_rxlog.rxsnp
It would appear that it cannot see the actual form, and has written this text into the void!
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Spy says Element is invisible when I can see it.

Post by odklizec » Tue Nov 10, 2015 8:20 am

Yeah, that's really weird. I can only guess it's either something with your app or a bug in Ranorex?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Spy says Element is invisible when I can see it.

Post by stapes » Wed Nov 11, 2015 10:40 am

Thank you. I am now in contact with Ranorex Support with this issue.

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

Re: Spy says Element is invisible when I can see it.

Post by Support Team » Fri Nov 13, 2015 2:37 pm

Hello,

Ranorex cached information for the initial instance of the dialog.
After the dialog was closed and re-opened, the cached information was used, which was no longer valid.
Therefore, the values were not set correct and the test case failed.

The issue has been solved by disabling the folder caching.
disable_folder_caching.png
Regards,
Johannes
You do not have the required permissions to view the files attached to this post.

zjv
Posts: 1
Joined: Fri Mar 18, 2016 3:00 pm

Re: Spy says Element is invisible when I can see it.

Post by zjv » Fri Mar 18, 2016 3:03 pm

I was also facing same issue and was looking for answer for so many days. Finally disabling Cache helped me.
But this seems issue with Ranorex as I was not facing this issue when I was identifying elements based on UIA. Once I started using WPF preferred xpath, this started failing.

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

Re: Spy says Element is invisible when I can see it.

Post by Support Team » Mon Mar 21, 2016 3:43 pm

Hello zjv,

Yes, you are right. Using UIA the above-mentioned issue did not happen.
The reason for this is that the new native WPF plugin works different from UI Automation.
Unfortunately, the only workaround at the moment is to disable folder caching for the corresponding elements.

Thank you for your understanding.

Sincerely,
Johannes