Page 1 of 1

Using Methods on invisible items (Dropdowns)

Posted: Mon Jul 08, 2019 4:06 pm
by RanoKarl
Operating System: Windows 10 Enterprise 1809
Ranorex: 9.0.1

I try to work on Comboboxes (Dropdowns with folders and elements inside) right now with Ranorex and encounter several problems.

https://www.ranorex.com/help/latest/ran ... hot-files/
First of all, I would like to provide a snapshot, but the generation of a snapshot with hidden elements using the Scroll key dont work for me. Maybe it's cause I've to press FN + Pause for this function, not sure. It starts the save dialog, but it tells me elements are missing.

About the actual problem:
After tracking an element of the dropdown, it finds all the treeitems (folders and actual items) which are in opened folders right now. Closed folders are not found. Some of those elements are Visible: True, the one I would have to scroll to are Visible: false if they're hidden outside the scroll area.
https://i.imgur.com/b8mRNmY.png

I tried to focus those elements with those methods:

Code: Select all

        		ti.EnsureVisible();
        		ti.Focus();
        		ti.MoveTo();
        		ti.Select();
But nothing works - the elements outside the visible area cannot be shown. I got a user code which open all visible treeItems which are actually folders via Usercode.

Code: Select all

ti.Expand();
This works, but only on visible elements, not on invisible ones.

This leads me to the conclusion, that methods only work on visible elements for me.

Now I hope to find a solution for all those problems ^^ Thx already.

Re: Using Methods on invisible items (Dropdowns)

Posted: Tue Jul 09, 2019 8:01 am
by odklizec
Hi,

Could you please share the snapshot (NOT screenshot) of the combo box? Sadly, without, at very least, snapshot, it's impossible to suggest best approach. Generally speaking, if EnsureVisible does not work with your UI, it may be necessary to write a custom method, which would scroll the combo box, either by using mouse clicks on combo box slider or using keyboard shortcuts Up/Down or PageUpDown. Simply put, there are cases and UIs, where the EnsureVisible is useless ;)

Re: Using Methods on invisible items (Dropdowns)

Posted: Tue Jul 09, 2019 9:18 am
by RanoKarl
I would love to present the snapshot, but as I wrote above...
First of all, I would like to provide a snapshot, but the generation of a snapshot with hidden elements using the Scroll key dont work for me. Maybe it's cause I've to press FN + Pause for this function, not sure. It starts the save dialog, but it tells me elements are missing.
... I can't. Is there any way to change this key?

About the custom method and programming stuff:
- Would it help if I post at least the paths?
- Is there anything the coders could do to make those EnsureVisibility Methods work?
- Is there a certain method to scroll on the top position quickly? Pos1 as key dont work, but maybe there's a method I dont know of.

Re: Using Methods on invisible items (Dropdowns)

Posted: Tue Jul 09, 2019 11:58 am
by odklizec
Hi,

Have you tried to save the snapshot via recording? In such recording, simply open the combo box (by click into it) and then add "Create snapshot" action, pointing to the expanded combo box (create and use a repo element for expanded combo box frame). This should help with saving combo box items. Anyway, I think that for the purpose of UI evaluation, it does not matter there will be missing some (invisible) items?

To scroll to the top of the list, I'm successfully using Home Key Shortcut action (eventually End for bottom of the list).

And as for making Ensure Visible to work for your UI, I'm afraid, this is not something that could be decided without actually seeing your app in action. Maybe you should contact Ranorex support about this and request a remote session with them?