Shoaib Akhtar
Shoaib Akhtar

Reputation: 1403

How to scroll to the bottom right most of the page within Robot Framework?

I am trying the below code to take the control to bottom right of the page but it is not working in my case.

Execute JavaScript | window.scrollTo(900,-900);

I tried other coordinates too, but still no success. Is there any other way to achieve this?

Upvotes: 2

Views: 8825

Answers (1)

Goralight
Goralight

Reputation: 2107

Instead of using

Execute JavaScript | window.scrollTo(900,-900);

Use this instead

Execute JavaScript | window.scrollBy(900, 900);

To help understand, and building on what Andersson said; the way your monitor works its coords is like a reversed graph

enter image description here

You start from the top left, and "add" to the right of the screen and then to the bottom of the screen.

0,0 being top left, and 1920,1080 being bottom right (given that you are using a 1080p monitor)

Any other problems please ask

Upvotes: 5

Related Questions