Page 1 of 1

Spy says Element is invisible when I can see it.

Posted: Mon Nov 09, 2015 2:30 pm
by stapes
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.

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

Posted: Mon Nov 09, 2015 2:40 pm
by odklizec
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.

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

Posted: Mon Nov 09, 2015 3:18 pm
by stapes
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!

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

Posted: Tue Nov 10, 2015 8:20 am
by odklizec
Yeah, that's really weird. I can only guess it's either something with your app or a bug in Ranorex?

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

Posted: Wed Nov 11, 2015 10:40 am
by stapes
Thank you. I am now in contact with Ranorex Support with this issue.

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

Posted: Fri Nov 13, 2015 2:37 pm
by Support Team
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

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

Posted: Fri Mar 18, 2016 3:03 pm
by zjv
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.

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

Posted: Mon Mar 21, 2016 3:43 pm
by Support Team
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