cancel
Showing results for 
Search instead for 
Did you mean: 

How to ScrollUp/Down web page to find a specific element? (Python)

SOLVED
Highlighted
New Contributor

How to ScrollUp/Down web page to find a specific element? (Python)

I want to create a generic function for scroll up/down which will perform the function until the element is visible

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: How to ScrollUp/Down web page to find a specific element? (Python)

Hi @tashishIf you want to find a specific element on a page, you can use special TestComplete features. If an element exists on a page, the tool will find it even if it's under the scroll. I recommend that you read the following article containing more information about finding objects on a web page:
https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/finding-objects...

 

If you do need to scroll until the target object, please use Alex's suggestion - you need to call the scrollIntoView method. You can find an example of how to do this on one of the previous conversations:

https://community.smartbear.com/t5/TestComplete-Functional-Web/How-can-i-Scroll-to-view-an-element-a... 


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

5 REPLIES 5
Highlighted
Community Leader

Re: How to ScrollUp/Down web page to find a specific element? (Python)

And do you want we write it for you ?

Please put your trial before asking.

Un sourire et ça repart

Highlighted
New Contributor

Re: How to ScrollUp/Down web page to find a specific element? (Python)

Okay. Solution Accepted. Thank you for the big help.

Highlighted
Community Leader

Re: How to ScrollUp/Down web page to find a specific element? (Python)

Sorry i didnt want to be rude but here we are all volunteer, taking our time trying help others.
But as for me you ask a solution without telling us what is your real problem ( scrolling, loop, visible) and no even showing the ideas and trials made.
And that make me feel like we are free dev for others....we aren't that.

So explain more, show you have think about the problem and we can work together..not alone

Un sourire et ça repart

Highlighted
Community Hero

Re: How to ScrollUp/Down web page to find a specific element? (Python)

Hi,

 

While @BenoitB is absolutely correct with his notes and questions, try to read the documentation for the .scrollIntoView native DOM method. Usually it works well.

 

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
================================
Highlighted
Community Manager

Re: How to ScrollUp/Down web page to find a specific element? (Python)

Hi @tashishIf you want to find a specific element on a page, you can use special TestComplete features. If an element exists on a page, the tool will find it even if it's under the scroll. I recommend that you read the following article containing more information about finding objects on a web page:
https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/finding-objects...

 

If you do need to scroll until the target object, please use Alex's suggestion - you need to call the scrollIntoView method. You can find an example of how to do this on one of the previous conversations:

https://community.smartbear.com/t5/TestComplete-Functional-Web/How-can-i-Scroll-to-view-an-element-a... 


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors