Hi again,
Before I could "freeze the list" by disabling the javascript and then read the list.
Now they did made some updates to code and now when I disable the javascript, only the items in view are shown so cannot read a constantly updating list anymore.
If I have the number of item in the list, what is the best way to read all the items? Can I use EnsureVisible(); or is the some other better way? I tried to MoveTo(), but it won't work if the item is not available.
Or should I scroll the list & disable javascript and read the items in view and then again enable javascript and scroll the list further?
Dynamic list
Re: Dynamic list
Hi,
It sounds as if the list is now lazy-loaded, which means that only the items visible in view are loaded. It's good programming practice, to save the memory and speed-up the GUI loading. On the other hand, it's hell for us TA guys
I'm afraid, EnsureVisible will most probably not help you, because the items you are looking for are not even loaded in memory. So your only hope to access them, is to use page Up/Down or Up/Down arrow keys. Eventually, you should be able to click the scroll bar buttons? In any case, it would require some code, which will help you to check, if the items you are looking for were loaded or not. Unfortunately, it's hard to suggest something more detailed without seeing your app under test.
It sounds as if the list is now lazy-loaded, which means that only the items visible in view are loaded. It's good programming practice, to save the memory and speed-up the GUI loading. On the other hand, it's hell for us TA guys
I'm afraid, EnsureVisible will most probably not help you, because the items you are looking for are not even loaded in memory. So your only hope to access them, is to use page Up/Down or Up/Down arrow keys. Eventually, you should be able to click the scroll bar buttons? In any case, it would require some code, which will help you to check, if the items you are looking for were loaded or not. Unfortunately, it's hard to suggest something more detailed without seeing your app under test.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Dynamic list
Thank you for your answer. Case is just like you described
I tried to make a repository item with variable and it worked fine with the visible items. But when need to scroll down the list, the index will get "broken".
I try to use page Up/Down or Up/Down arrow keys.
I cannot "select/highlight" the list item without mouse
So should I read the visible items, then scroll the list to see more list items and then read them?
I tried to make a repository item with variable and it worked fine with the visible items. But when need to scroll down the list, the index will get "broken".
I try to use page Up/Down or Up/Down arrow keys.
I cannot "select/highlight" the list item without mouse
So should I read the visible items, then scroll the list to see more list items and then read them?
Re: Dynamic list
"Unfortunately, it's hard to suggest something more detailed without seeing your app under test"
I created a support ticket for this case. Because there seems not to be a generic resolve to this problem.
I created a support ticket for this case. Because there seems not to be a generic resolve to this problem.
Re: Dynamic list
Yep, it's probably your only hope.SanMan wrote:So should I read the visible items, then scroll the list to see more list items and then read them?
Here is the code I'm using in one my tests, where list of items is lazy loaded. scheduleInfoElement is a repo element with xpath containing a name of item (passed via variable) I need to select. Basically, it first scrolls the list to the first list item (using Home button), then it scrolls the list items (one by one) by Down key, until the scheduleInfoElement is found.
Code: Select all
public void ScrollToScheduling(RepoItemInfo scheduleInfoElement)
{
SpanTag scheduleElement=null;
Keyboard.PrepareFocus(repo.RPDashboard_Dom.ListBox.ListBox_LST);
Keyboard.Press(System.Windows.Forms.Keys.Home, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
while (!scheduleInfoElement.Exists(5000, out scheduleElement))
{
Keyboard.Press(System.Windows.Forms.Keys.Down, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Delay.Duration(20);
}
Keyboard.Press(System.Windows.Forms.Keys.Enter, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Delay.Duration(20);
}
Code: Select all
./body/div[@id~'listBox' and @visible='True']/div[@id~'innerListBox' and @class~'jqx-listbox']//div[@class='jqx-listitem-element']/span[@innertext~$scheduleName and @class~'selected']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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