How to Scroll Up till start of the Web page

Hi,
I have to scroll up till the start of a web page. I use send hotkey activity with “PgUp” and “up” but it did not scroll the page till the start of th page.

So, Please can any one help me with this issue?

Thanks,

Hi @awaisji2001 welcome to forum

Is throwing any error?

No there is no error and execution is not ended

Hi @awaisji2001,

Why does it not work?
The newer browsers have not defined a shorcut to scroll up or down the page with a single pgdn or pgup hotkey.

Reference

  1. Chrome keyboard shortcuts - Computer - Google Chrome Help
  2. Keyboard shortcuts in Microsoft Edge

An ok but not so clean solution
You will need to guess the number of times you will need to send the hotkey or use an Image Exists logic when you reach your target position (for example, the website banner) and then stop sending the hotkey.

You can do this by assuming (after manual testing) on your website using
Enumerable.Range(0,YourIntendedNumberOfKeyPresses)

Scroll.xaml (8.5 KB)

2 Likes

Hi @awaisji2001

In addition to suggested by jeevith

You can use set focus activitiy with focusing any element at the top page

Try with that

Hope it helps you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

2 Likes

Hi,
@jeevith Sir Thanks for helping me.

Hi, Sir @jeevith here is a problem still remains. The problem is that in this equation Enumerable.Range(0,15) how i make 0 and 15 indexes generic in this scenario.

Hi, Sir @jeevith here is a problem still remains. The problem is that in this equation Enumerable.Range(0,15) how i make 0 and 15 indexes generic in this scenario.

The main purpose is to scroll until the first message. In some cases, messages are in small numbers but in some cases, messages are in large numbers.

The question is that how I pass the generic indexes to Enumerable.Range(0,15) this equation ??

Hi @awaisji2001

In the for each loop in addition to sent hotkey put a element exist condition indicating top part of chat, then put the if condition signifying the element exist and do accordingly