lazy loading - objects not yet in memory
I am working with an application that uses lazy loading. In one of my tests, I am accessing a row that is visible on a normal monitor. Today I am working on my small laptop and the row is not only not visible, it is not even in memory because the app uses lazy loading to create the objects as they are needed. I can't find a way to scroll before finding the needed row (when I use several of the scroll methods for javascript I get a 'member not found' error. I can't define the row number and then scrollIntoViewIfNeeded because the row doesn't exist to find in the first place so it errors on that (panel(x) could not be found). Suggestions?
FindChild by itself still won't overcome the lazy-load... that's why my PseudoCode had the PageDown call in a while loop. I'd re-write your code as follows.
function findRow() { var Row = 8; var List = Aliases.pageDispatch.ListDispatchJobs; var child = List.FindChild("Name", "Panel(" + (Row -1) + ")", 1, true); while (!child.Exists) { List.Keys("[PageDown]"); child = List.FindChild("Name", "Panel(" + (Row -1) + ")", 1, true); } Log.Message(child.contentText); }
This will check to see if the child exists. If not, it sends a page down keystroke to scroll the list and then checks again. When it does exist, it exits the while loop and the child object is now the desired object.