Forum Discussion

fayizkc's avatar
fayizkc
Occasional Contributor
6 years ago

How to load all contents of a div in a web page for lazy loading

I am automating my web application with xpath. I have some line items <li> under a <div>. This div has scroll bar.  i have muliple items in the div. It will load completely only when i scrol to end (Lazy loading). How can I scroll down in the div or how can load all items in div by Jscript.

I tried .setfocus on last loaded. It is showing as not supported

I tired Sys.HighlightObject that also not supporting

Also tried scrollIntoView(true). it is scrolling only the window scroll not div scroll. 

Can you please help me to resolve this

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    As a quick idea: is it possible to click or .SetFocus() either on the div itself or on some relevant parent/child and scroll them to the end then by sending .Keys('[End]') (or Ctrl-End, or Ctrl-PgDn, or...) ?

     

    • fayizkc's avatar
      fayizkc
      Occasional Contributor
      When i use the xpath of object with text, scrollIntoView is working. But when i check the object count with EvaluateXpath, taking more than 15 minutes to execute that line with cont of 280. So when use loop to load all items in a div, taking more than 45 minuts, which i can do manually with 1 minute. Is there any fast way to get object count with xpath
      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Using TestComplete's object recognition engine, you can find the count easily as a property of the parent object.  Should be something like "ChildCount" or "ItemCount" as a property of the object.  Use the builty in Object Spy tool in test complete, investigating the component, and look to see what properties are available.