cancel
Showing results for 
Search instead for 
Did you mean: 

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

fayizkc
Occasional Contributor

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 3
AlexKaras
Community Hero

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

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...) ?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
fayizkc
Occasional Contributor

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

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
Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors